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

is_last() bool[source]

Checks if current page is the last one

Returns:

True if current page is the last one, False otherwise

next_page_number() int[source]

Gets next page number

Returns:

Next page number

previous_page_number() int[source]

Gets previous page number

Returns:

Previous page number

class lime_trader.models.page.PageRequest(page: int = 1, size: int = 20)[source]

Bases: object

Page specification

page

Page number

Type:

int

size

Page size

Type:

int

get_offset() int[source]

Gets items offset for current page

Returns:

Integer representing offset