Support for nulls_first / nulls_last in CursorPagination #9456
Unanswered
jonatanvm
asked this question in
Ideas & Suggestions
Replies: 1 comment
-
I was also looking to discuss the same feature. If this feature is added, it will be a great help. |
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
-
Django supports asc(nulls_first=None, nulls_last=None) and desc(nulls_first=None, nulls_last=None), but DRF does not.
Even if you write your own OrderingFilter which orders the results with nulls last, CursorPagination will override that in:
My suggestion is to add a configurable class variable that let's us configure whether nulls will be sorted first or last. Alternatively it would be helpful if ordering was extracted to a function that could be overridden.
Beta Was this translation helpful? Give feedback.
All reactions