class Paginator:
Undocumented
Method | get_elided_page_range |
Return a 1-based range of pages with some values elided. |
Method | get_page |
Return a valid page, even if the page argument isn't a number or isn't in range. |
Method | page |
Return a Page object for the given 1-based page number. |
Constant | ELLIPSIS |
Undocumented |
Instance Variable | allow_empty_first_page |
Undocumented |
Instance Variable | object_list |
Undocumented |
Instance Variable | orphans |
Undocumented |
Instance Variable | per_page |
Undocumented |
Method | __init__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | _check_object_list_is_ordered |
Warn if self.object_list is unordered (typically a QuerySet). |
Method | _get_page |
Return an instance of a single page. |
Method | validate_number |
Validate the given 1-based page number. |
Property | count |
Return the total number of objects, across all pages. |
Property | num_pages |
Return the total number of pages. |
Property | page_range |
Return a 1-based range of pages for iterating through within a template for loop. |
Return a 1-based range of pages with some values elided.
If the page range is larger than a given size, the whole range is not provided and a compact form is returned instead, e.g. for a paginator with 50 pages, if page 43 were the current page, the output, with the default arguments, would be:
1, 2, …, 40, 41, 42, 43, 44, 45, 46, …, 49, 50.
Return an instance of a single page.
This hook can be used by subclasses to use an alternative to the standard :cls:`Page` object.