Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)

        def paginate(queryset, number, per_page, reverse=False):
    paginator = Paginator(queryset, per_page)
    
    try:
        page = paginator.page(number)
    except PageNotAnInteger:
        # If page is not an integer, deliver first page.
        page = paginator.page(1)
    except EmptyPage:
        # If page is out of range (e.g. 9999), deliver last page of results.
        page = paginator.page(paginator.num_pages)

    paginator.page_ranges = get_page_ranges(page.number, paginator.num_pages)
    if reverse:
        paginator.page_ranges.reverse()
        for r in paginator.page_ranges:
            r.reverse()
    return page
        


src/d/j/django-pager-0.1.7/django_pager/__init__.py   django-pager(Download)
from django_pager.pager import paginate