Implement CursorPagination without OrderingFilter #12772
GCHQDeveloper926
started this conversation in
General
Replies: 1 comment
-
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Ref PR #10764, I've managed to get cursor pagination working by providing a default OrderingFilter, which gets round the previous exception of
assertionerror: using cursor pagination, but filter class orderingfilter returned a none ordering
.Looking at the docs for Django and what they advise for CursorPagination I'm not entirely sure whether you would want to use ordering and cursorPagination together, it feels like it would be more useful in a scenario where you want cursor efficiency but don't care about the ordering (bulk updates, deletes, exports etc).
Would people be happy with me reopening #9716 / #9599 on a new PR and providing an implementing that doesn't use ordering but just uses a default of "created" as the field?
TL:DR @jeremystretch originally closed because they didn't have time to track down the bug - my suggestion is to hard code the filter following the Django docs guidance.
Originally posted by @jeremystretch in #10764 (comment)
Beta Was this translation helpful? Give feedback.
All reactions