Flourish API: flourish.paginator
On pages which have been paginated,
Flourish provides the template context with a Paginator object.
Paginator methods
paginator.count— the number of objects (not pages) that were paginatedpaginator.num_pages— the number of pages in this paginated collection, as a single integerpaginator.page_range— the pages in this paginated collection, as a list (eg. [1, 2, 3])paginator.page— returns aPageobject representing a single page of this paginated collectionpaginator.pages— returns a list ofPageobjects, one for each page of this paginated collection
Page methods
page.has_next—Trueif there is a page after this one in the collection, otherwiseFalsepage.next_page_number— the number of the next page in the collectionpage.has_previous—Trueif there is a page before this one in the collection, otherwiseFalsepage.previous_page_number— the number of the previous page in the collectionpage.has_other_pages—Trueif there is more than one page in this collectionstart_index— the index within the entire paginated collection of the first item in this page (eg. with 10 items per page, the third page would have astart_indexof 21)end_index— the index within the entire paginated collection of the last item in this page (eg. with 10 items per page, the third page would have anend_indexof 30)url— the URL of this page, made by appendingpage-Nto the base URL of the entire collection