Need to document paging variables added to template context by object_list
|Reported by:||mikechambers||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The django.views.generic.list_detail.object_list api should be documented to include which pagination name / value pairs are added the templates context.
The properties (from the code documentation are):
is_paginated : are the results paginated?
results_per_page : number of objects per page (if paginated)
has_next : is there a next page?
has_previous : is there a prev page?
page : the current page
next : the next page
previous : the previous page
pages : number of pages, total
hits : number of objects, total
last_on_page : the result number of the last of object in the object_list (1-indexed)
first_on_page : the result number of the first object in the object_list (1-indexed)
page_range : A list of the page numbers (1-indexed).
This information does not appear to be available in the docs anywhere which makes implementing paging more difficult than it should be.
Change History (5)
comment:1 follow-up: ↓ 2 Changed 7 years ago by ubernostrum
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Resolution set to worksforme
- Status changed from new to closed
Changed 7 years ago by mikechambers
comment:3 Changed 7 years ago by mikechambers
- Has patch set
- Resolution worksforme deleted
- Status changed from closed to reopened