When ItemPage is specified for item_search it does not return the result from that page but from first page

Issue #37 resolved
Kwan Hong Lee
created an issue

The paginators.py module should be changed to:



class BaseResultPaginator(object): def init(self, fun, args, kwargs, counter): """ :param counter: counter variable passed to AWS. :param limit: limit fetched pages to this amount (restricted to a maximum of 400 pages by API itself). """ self.fun = fun self.args, self.kwargs = args, kwargs self.counter = counter self.limit = kwargs.get('limit', 400)

    # fetch first page to get pagination parameters
    self._first_page = self.page(kwargs.get(self.counter,1))


The last line self._first_page = self.page(kwargs.get(self.counter, 1)) should fix things

Comments (3)

  1. Kwan Hong Lee reporter

    Here's a sample code attached. In the main if you change the page number, it still gives same output. But if you make the fix above, it will start the page from the page number given.

  2. Log in to comment