Returning queryset instead of list in paginate_queryset() #8264
Unanswered
revanthgss
asked this question in
Ideas & Suggestions
Replies: 1 comment
-
I've a similar problem with the CursorPagitation. After the pagination I need to make an aggregation query on the paginated results in order to the correct cache-control header (depending on the paginated result I might set higher/lower cache-control max-age). It would great if the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The paginate_queryset() function in PageNumberPagination Class is returning list(self.page) instead of self.page. Using list() evalutates the queryset and if we need to do further processing, we need to make another query. If we use queryset, the page can be directly fetched in list serializers and processed further without evaluating queryset.
I think the list is used because some of the custom paginations like CursorPagination might force us to evaluate the queryset.
Please put down your thoughts and suggestions regarding this.
Beta Was this translation helpful? Give feedback.
All reactions