django-pager

0.1.7 MIT/X Consortium License    
  UNRATED

  97 downloads

Django Pagination

description

download

specs

django-pager is a Django app for that provides pagination support.

Installation

    pip install django-pager

Configuration

settings.py

    INSTALLED_APPS = (
        ...
        'django_pager',
    )


Usage

views.py

    from django_pager import paginate

    def listing(request):
        qs = Contact.objects.all()
        page = request.GET.get('page', 1)
        contacts = paginate(qs, page, 10)
        # You can also get page numbers reversed
        # contacts = paginate(qs, page, 10, reverse=True)
        return render_to_response('list.html', {"contacts": contacts})


list.html

    {% include 'django_pager/pager.html' with objects=contacts %}
read more   
Last updated on September 20th, 2012

#Django pagination #Django pager #Django app #Django #pager #pagination #article

0 User reviews so far.

SUBMIT