Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > HTTP (WWW)

    django-infinite-pagination 1.0

    Download button

    No screenshots available
    Downloads: 115  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Filip Wasilewski | More programs
    BSD License / FREE
    June 10th, 2012, 08:06 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    django-infinite-pagination description

    Infinite pagination for Django

    django-infinite-pagination is a very simple helper for Django 1.4 that does one thing: efficiently paginates large object collections on systems where using standard Django Paginator is impractical because of significant count(*) query overhead (i.e. PostgreSQL).

    Under the hood it uses a single query to retrieve objects for the current page and check for availability of a successive page.

    The InfinitePaginator is a replacement for Django django.core.paginator.Paginator.

    Quick Start

    Include django-infinite-pagination in your requirements file (or pip install django-infinite-pagination) and add infinite_pagination to INSTALLED APPS.

    Then set the paginator_class attribute of your ListView-based view to InfinitePaginator and specify paginate_by attribute:

    class ArticleListView(ListView):
     model = Article
     paginate_by = 10
     paginator_class = InfinitePaginator


    To display pagination links in a template load the infinite_pagination template tags and put {% paginate %} in the place you would like the pagination links to show up:

    {% load infinite_pagination %}

    {% for object in object_list %}
     {{ object }}
    {% endfor %}

    {% paginate %}


    A generic pagination/infinite_pagination.html template that works well with Twitter Bootstrap stylesheet is provided by this application. Adjust it to your requirements.

    Paginating in Templates

    Sometimes application views cannot be modified and the pagination can only be done at the template level. The autopaginate template tag is provided as a last resort of applying pagination to object lists inside templates:

    {% load infinite_pagination %}

    {% autopaginate object_list per_page=10 as paginated_list %}

    {% for object in paginated_list %}
     {{ object }}
    {% endfor %}

    {% paginate %}


    The autopaginate tag takes a queryset and a number of items per page as input and returns a page slice for displaying in a template. Current page number is retrieved from template context or page request GET params. It can also be specified as an optional tag param:

    {% autopaginate object_list per_page=10 page=2 as paginated_list %}

    The tag also sets paginator and page_obj template context variables for the paginate tag that uses them to render navigation links.


    Product's homepage

    Requirements:

    · Python
    · Django

      


    TAGS:

    infinite pagination | Django pagination | Django | infinite | pagination

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM