Opened 17 years ago
Closed 16 years ago
#7161 closed (wontfix)
Date-based views provide inappropriate dates for next_/previous_ day/month
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Generic views | Version: | dev |
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 |
Easy pickings: | no | UI/UX: | no |
Description
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.
Attachments (1)
Change History (3)
by , 17 years ago
Attachment: | date_based.next_prev.diff added |
---|
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 16 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
#3585 proposed something similar but maintaining backward compatibility (by providing new context vars with the values of next/prev month/day containing a object of the queryset) and was closed wontfix. This ticket proposes changing the semantics of the currently available context vars and so would be backwards incompatible.
Thus, I'm also closing it as wontfix.