Ticket #7166: 7166.patch

File 7166.patch, 1.3 KB (added by mikechambers, 16 years ago)

Patch to include documentation on pagination variables exposed in template

  • docs/generic_views.txt

     
    816816These values and lists are 1-based, not 0-based, so the first page would be
    817817represented as page ``1``.
    818818
     819When pagination is enabled, the following variables will be available within the template.
     820
     821**Pagination variables:**
     822
     823    * ``is_paginated``: A boolean specifying whether the results are paginated.
     824
     825    * ``results_per_page``: The number of objects per page (if paginated).
     826
     827    * ``has_next``: A boolean specifying whether there is a next page.
     828
     829    * ``has_previous``: A boolean specifying whether there is a previous page.
     830
     831    * ``page``: The current page number.
     832
     833    * ``next``: The next page number.
     834
     835    * ``previous``: The previous page name.
     836
     837    * ``pages``: The total number of pages.
     838
     839    * ``hits``: The total number of objects.
     840
     841    * ``last_on_page``: The result number of the last of object in the object_list (1-indexed).
     842
     843    * ``first_on_page``: The result number of the first object in the object_list (1-indexed).
     844
     845    * ``page_range``: A list of all page numbers (1-indexed).
     846
    819847An example of the use of pagination can be found in the `object pagination`_
    820848example model.
    821849         
Back to Top