Page¶
- class lime_trader.models.page.Page(data: list[T], number: int, size: int, total_elements: int)[source]¶
Bases:
Generic
[T
]Represents one page of items
- data¶
Items in a page.
- Type:
list[lime_trader.models.page.T]
- number¶
Page number
- Type:
int
- size¶
Page size
- Type:
int
- total_elements¶
Number of existing elements. It does not represent number of elements in a page but number of elements in total
- Type:
int
- get_total_pages() int [source]¶
Get number of total pages based on total elements and page size
- Returns:
Number of existing pages
- has_next() bool [source]¶
Checks if there is a page after current one
- Returns:
True if next page exists, False otherwise
- has_previous() bool [source]¶
Checks if there is a page before current one. Will be False just for the first page
- Returns:
True if previous page exists, False otherwise