-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to ensure consistent ordering when sorting? #861
Comments
ddahan
changed the title
How to ensure consistent order when sorting?
How to ensure consistent ordering when sorting?
Aug 12, 2022
Currently, there is no way to define an extra field to sort on. I'm not convinced that this is a feature worth implementing: certain columns would not need this, how do you suppose to configure that? I'd say this case should be solved by explicitly adding the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When sorting the table by clicking on a header, if there are rows that have the same value, the order can not be consistent from one query to another. Is there a way to specify a "secondary" sorting criteria?
For example, when user clicks on the
price
header to sort rows by price, behind the scene I'd like to haveordering = (price, pk)
sothat the result is guarantee to be the same, given the same queryset.For now, I succeeded with :
However, doing this for every column is tedious, there must be a better way.
Thanks.
The text was updated successfully, but these errors were encountered: