archive_index shouldn't do explicit ordering
|Reported by:||ubernostrum||Owned by:||nobody|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Currently, the date-based archive_index and archive_year (when make_object_list is True) generic views use explicit calls to order_by to re-order the QuerySet they receive. There are two problems with this:
- They do it inconsistently: archive_index sorts by date_field descending, while archive_year sorts by date_field ascending.
- In doing so, they override any ordering specified by the model or already applied to the QuerySet, reducing their flexibility.
For sake of consistency with each other and with the other date-based generic views, and to restore the flexibility of allowing the user to choose how the QuerySet will be ordered, both views should stop trying to do an explicit order_by.
Change History (5)
Changed 9 years ago by ubernostrum
comment:1 Changed 9 years ago by Simon G. <dev@…>
- Has patch set
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Ready for checkin
comment:2 Changed 9 years ago by mtredinnick
- Triage Stage changed from Ready for checkin to Design decision needed
comment:3 Changed 9 years ago by gwilson
- Summary changed from archive_year and archive_index shouldn't do explicit ordering to archive_index shouldn't do explicit ordering