adjunct.pagination¶
Pagination support.
paginator(page_num, max_page, buffer_size=3)
¶
Generate a sequence of page numbers, giving the pages at the beginning
and end, and around the current page, with a number of buffer pages on
each side of both. Omitted pages in the sequence are elided into a None.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page_num
|
int
|
the current page |
required |
max_page
|
int
|
the maximum page number to create a link to |
required |
buffer_size
|
int
|
the number of page links to generate on each side of the current page |
3
|
Yields:
| Type | Description |
|---|---|
int | None
|
A page number, or |