[patch] The archive_year date-based generic view should not override a model's default ordering
|Reported by:||matt.riggott@…||Owned by:||jacob|
|Cc:||gary.wilson@…||Triage Stage:||Design decision needed|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The archive_month, archive_week, and archive_day date-based generic views all respect a model's default ordering — that is, none of those generic views append order_by() when they filter a QuerySet. The archive_year view, however, will always return a chronological list of objects; this cannot be overridden.
The offending code is line 79 (in the current Subversion trunk).
I might be wrong, but I think archive_year should adhere to a model's default ordering, as the related date-based views do. But since this would change the expected behaviour of a lot of existing sites, I guess an optional parameter allowing a programmer to specify the ordering would be nice. I'll attach a patch.
Change History (10)
Changed 8 years ago by Matt
comment:1 Changed 8 years ago by anonymous
- Summary changed from The archive_year date-based generic view should not override a model's default ordering to [patch] The archive_year date-based generic view should not override a model's default ordering
comment:8 Changed 8 years ago by Gary Wilson <gary.wilson@…>
- Triage Stage changed from Unreviewed to Design decision needed