How to add cursor pagination in my Djapy views. #10
-
Here's how you can use @djapify(
pagination_class=CursorPagination,
auth=None
)
@djapy_auth(SessionAuth, permissions=['plans.view_todo'])
def todo_get(request, *args, **kwargs) -> list[TodoSchema]:
print(request.user.get_user_permissions())
todos = Todo.objects.all()
return todos |
Beta Was this translation helpful? Give feedback.
Answered by
Bishwas-py
Mar 9, 2024
Replies: 1 comment
-
That structure has been just reconsidered and @djapify
@paginate
@djapy_auth(SessionAuth, permissions=['plans.view_todo'])
def todo_get(request, *args, **kwargs) -> list[TodoSchema]:
todos = Todo.objects.all()
return todos
# or
from djapy.pagination import CursorPagination
@paginate(CursorPagination)
def todo_get(request, *args, **kwargs) -> list[TodoSchema]: |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Bishwas-py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That structure has been just reconsidered and
@paginate
decorator in added: