graviti.paging.offset
#
Paging list offset related class.
Module Contents#
Classes#
The offsets manager of the paging list. |
- class graviti.paging.offset.Offsets(total_count, limit)[source]#
The offsets manager of the paging list.
- Parameters
total_count (int) – The total count of the elements in the paging list.
limit (int) – The size of each page.
- update(self, start, stop, lengths)[source]#
Update the offsets when setting or deleting paging list items.
- Parameters
start (int) – The start index.
stop (int) – The stop index.
lengths (Iterable[int]) – The length of the set values.
- Return type
None
- get_coordinate(self, index)[source]#
Get the page coordinate of the elements.
- Parameters
index (int) – The index of the element in paging list.
- Returns
The page number and the index of the page.
- Return type
Tuple[int, int]