Date-based views provide inappropriate dates for next_/previous_ day/month
|Reported by:||Ionut Ciocirlan <ionut.ciocirlan@…>||Owned by:||nobody|
|Severity:||Keywords:||date-based next previous|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The archive_month's and archive_day's next_* / previous_* are not appropriate, given the views are aware of the queryset. The simplistic +-1 day/month calculations should debatably go into a filter. But the real issue is that with allow_empty=False (which is the default), the current implementation will easily lead to 404 pages, rendering them rather useless. Not everybody publishes items every day, or every month for that matter.
The attached patch turns next_day / previous_day / next_month / previous_month into callables, so they will get lazily executed when used in the template. It depends on the patch in ticket #7153 to work.
Change History (3)
Changed 7 years ago by Ionut Ciocirlan <ionut.ciocirlan@…>
comment:1 Changed 7 years ago by programmerq
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Design decision needed