(
self,
stmt: Union[Select, SelectOfScalar, Type[ModelT]],
pagination: PaginationParams,
**filters
)
| 78 | return items, total |
| 79 | |
| 80 | async def get_paginated_response( |
| 81 | self, |
| 82 | stmt: Union[Select, SelectOfScalar, Type[ModelT]], |
| 83 | pagination: PaginationParams, |
| 84 | **filters |
| 85 | ) -> PaginatedResponse[Any]: |
| 86 | items, total = await self.paginate( |
| 87 | stmt=stmt, |
| 88 | page=pagination.page, |
| 89 | size=pagination.size, |
| 90 | order_by=pagination.order_by, |
| 91 | desc=pagination.desc, |
| 92 | **filters |
| 93 | ) |
| 94 | |
| 95 | total_pages = (total + pagination.size - 1) // pagination.size |
| 96 | |
| 97 | return PaginatedResponse[Any]( |
| 98 | items=items, |
| 99 | total=total, |
| 100 | page=pagination.page, |
| 101 | size=pagination.size, |
| 102 | total_pages=total_pages |
| 103 | ) |
no test coverage detected