def paginate_results(self, results, options):
        "Return a django.core.paginator.Page of results."
        limit = options.get('limit', settings.SELECTABLE_MAX_LIMIT)
        paginator = Paginator(results, limit)
        page = options.get('page', 1)
        try:
            results = paginator.page(page)
        except (EmptyPage, InvalidPage):
            results = paginator.page(paginator.num_pages)
        return results
def paginate_results ( self , results , options ) : limit = options . get ( 'limit' , settings . SELECTABLE_MAX_LIMIT ) paginator = Paginator ( results , limit ) page = options . get ( 'page' , 1 ) try : results = paginator . page ( page ) except ( EmptyPage , InvalidPage ) : results = paginator . page ( paginator . num_pages ) return results
Return a django.core.paginator.Page of results.