

def paginate_queryset(self, queryset, request_data):
    "\n        Paginate the search results. This is a simplified version of\n        Django's MultipleObjectMixin.paginate_queryset\n        "
    paginator = self.get_paginator(queryset)
    page_kwarg = self.page_kwarg
    page = request_data.get(page_kwarg, 1)
    try:
        page_number = int(page)
    except ValueError:
        if (page == 'last'):
            page_number = paginator.num_pages
        else:
            raise InvalidPage(_("Page is not 'last', nor can it be converted to an int."))
    return (paginator, paginator.page(page_number))

dataset/ETHPy150Open django-oscar/django-oscar/src/oscar/apps/search/search_handlers.py SearchHandler.paginate_queryset/original