Store the current request in CursorPagination #8761
Replies: 1 comment 1 reply
-
|
Sure. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Background: Both
PageNumberPaginationandLimitOffsetPaginationstore the current request inside of thepaginate_querysetmethod (here and here respectively) into theself.requestvariable.CursorPaginationdoesn't do this.Proposal: I suggest a change to store the current request into the
self.requestvariable also forCursorPagination; I'm happy to open a pull request if the proposal is accepted.Rationale: Having access to
self.requestinside of the pagination classes is useful as it makes the classes easier to extend: when overriding methods we (for example) can access all the query parameters, etc. Additionally, making the access toself.requestconsistent across all three built-in pagination types makes it easier to swap around the classes while keeping any custom overridden code the same.Beta Was this translation helpful? Give feedback.
All reactions