Skip to content

How to add cursor pagination in my Djapy views. #10

Closed Answered by Bishwas-py
Bishwas-py asked this question in Q&A
Discussion options

You must be logged in to vote

That structure has been just reconsidered and @paginate decorator in added:

@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]:

Replies: 1 comment

Comment options

Bishwas-py
Mar 9, 2024
Maintainer Author

You must be logged in to vote
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
Category
Q&A
Labels
None yet
1 participant