rpkilby / django-filter

A generic system for filtering Django QuerySets based on user selections
https://django-filter.readthedocs.org
Other
0 stars 1 forks source link

Rework ordering #3

Closed rpkilby closed 8 years ago

rpkilby commented 8 years ago

Hey @carltongibson, I wanted to submit this PR internally to the label improvements branch, due to the growing scope creep of the original PR (label improvements, reworked ordering, deprecations, docs, etc...). Want to keep that PR from becoming un-reviewable. This makes the label improvements branch fully compatible with the existing ordering features, except for get_order_by and get_ordering_field (refactored, no longer invoked).

The objective is to completely deprecate the ordering features on the FilterSet, instead encouraging the use of an explicitly declared ordering filter. In theory, order_by and the refactored get_ordering_filter could be kept, however I think it's better to remove it. The existing behavior of order_by is just not compatible with too many use cases. Maybe the deprecation could become a behavior change to order_by?

Details: In short, this completely reworks ordering into two ordering filters.

Changes:

Notes:

TODO:

rpkilby commented 8 years ago

Hey @carltongibson - this has been reworked into a separate PR that is not dependent on the label/form improvements. It would be great to get it merged into the 0.15 release, as it also has a number of deprecations.