def paginate_items(self, request, items):
        paginate_by = self.get_paginate_by(request)
        if not paginate_by:
            return (None, None, items)

        paginator = Paginator(items, paginate_by,
            allow_empty_first_page=self.allow_empty)
        page = request.GET.get('page', 1)

        try:
            page_number = int(page)
            page = paginator.page(page_number)
        except (__HOLE__, InvalidPage):
            page = paginator.page(1)
        return (paginator, page, page.object_list)
dataset/ETHPy150Open gerry/django-jqgrid/jqgrid.py/JqGrid.paginate_items