core.paginator.Page.start_index()

Page.start_index() [source] Returns the 1-based index of the first object on the page, relative to all of the objects in the paginator’s list. For example, when paginating a list of 5 objects with 2 objects per page, the second page’s start_index() would return 3.

core.paginator.Paginator

class Paginator(object_list, per_page, orphans=0, allow_empty_first_page=True) [source]

core.paginator.Page.paginator

Page.paginator The associated Paginator object.

core.paginator.Paginator.num_pages

Paginator.num_pages The total number of pages.

core.paginator.Page.previous_page_number()

Page.previous_page_number() [source] Returns the previous page number. Raises InvalidPage if previous page doesn’t exist.

core.paginator.Paginator.count

Paginator.count The total number of objects, across all pages. Note When determining the number of objects contained in object_list, Paginator will first try calling object_list.count(). If object_list has no count() method, then Paginator will fallback to using len(object_list). This allows objects, such as Django’s QuerySet, to use a more efficient count() method when available.

core.paginator.Page.number

Page.number The 1-based page number for this page.

core.paginator.Page.next_page_number()

Page.next_page_number() [source] Returns the next page number. Raises InvalidPage if next page doesn’t exist.

core.paginator.Page.has_previous()

Page.has_previous() [source] Returns True if there’s a previous page.

core.paginator.Page.end_index()

Page.end_index() [source] Returns the 1-based index of the last object on the page, relative to all of the objects in the paginator’s list. For example, when paginating a list of 5 objects with 2 objects per page, the second page’s end_index() would return 4.