This library adds a new pagination class for use with django-ninja which supports cursor-based pagination.
pip install django-ninja-cursor-pagination
from ninja.pagination import paginate
from ninja_cursor_pagination import CursorPagination
@router.get("/things", response=list[ThingSchema])
@paginate(CursorPagination)
def list_things(request):
return Thing.objects.order_by("title")