Re: Inconsistent pagination when sorting by non-unique columns (ticket 34251)

2023-01-12 Thread Jörg Breitbart
We had a similar issue in table views, where users can highly customize the output (like switching on/off columns, complex filtering and custom multilevel ordering). For the ordering issue at hand the solution was to append the pk as n-th order directive on the queryset, if all previous fields

Re: Inconsistent pagination when sorting by non-unique columns (ticket 34251)

2023-01-12 Thread Adrian Torres
I've been bitten by this once before as well but I think it's the kind of mistake you make once and never again, and if you happen to encounter it again you immediately know what it is (duplicated/missing items across pages? must be a non-unique ordering). I don't think implicitly adding an ext

Re: Inconsistent pagination when sorting by non-unique columns (ticket 34251)

2023-01-11 Thread tatari...@gmail.com
Thanks for the input, Barry! To be clear - Django already enforces total ordering in the admin panel by adding "pk" (in this method ), which makes me believe that's a viable approach. Sure, there can be domain-s

Re: Inconsistent pagination when sorting by non-unique columns (ticket 34251)

2023-01-11 Thread 'Barry Johnson' via Django developers (Contributions to Django itself)
I'd be very much -1 if the framework modified my sorting parameters (by adding 'pk' at the end of the ordering). As mentioned, it can certainly break queries that can be handled by a covering index... but mostly because 'pk' isn't the field we would prefer to use in this case anyway. For ex