MCPcopy Create free account
hub / github.com/dataease/SQLBot / get_paginated_response

Method get_paginated_response

backend/common/core/pagination.py:80–103  ·  view source on GitHub ↗
(
        self,
        stmt: Union[Select, SelectOfScalar, Type[ModelT]],
        pagination: PaginationParams,
        **filters
    )

Source from the content-addressed store, hash-verified

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 )

Callers 4

pagerFunction · 0.95
option_pagerFunction · 0.95
pagerFunction · 0.95
list_pageFunction · 0.95

Calls 1

paginateMethod · 0.95

Tested by

no test coverage detected