I read through the docs here https://docs.litestar.dev/latest/usage/responses.html#pagination
I want custom pagination behavior where I want the last n results sorted by timestamp
For example this is from the inertia fullstack example
@get(
operation_id="ListUsers",
name="users:list",
summary="List Users",
description="Retrieve the users.",
path="/api/users",
cache=60,
)
async def list_users(
self,
users_service: UserService,
filters: Annotated[list[FilterTypes], Dependency(skip_validation=True)],
) -> OffsetPagination[schemas.User]:
"""List users."""
results, total = await users_service.list_and_count(*filters)
return users_service.to_schema(data=results, total=total, schema_type=schemas.User, filters=filters)
How do I get the most recent 10 users for instance?