MCPcopy Create free account
hub / github.com/dbunt1tled/python-fast-api / Pagination

Class Pagination

src/core/db/repository.py:90–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88
89@dataclass
90class Pagination:
91 page: int = 1
92 per_page: int = 10
93
94 @property
95 def offset(self) -> int | None:
96 if self.page is None or self.per_page is None or self.page == 0 or self.per_page == 0:
97 return None
98
99 return (self.page - 1) * self.per_page
100
101
102class Paginator(Generic[T]):

Callers 2

user_listMethod · 0.90
listMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected