Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#608 closed enhancement (duplicate)

Allow objects with future dates to display in date based generic views

Reported by: scaba Owned by: Jacob
Component: Generic views Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The date based generic views are coded to only show objects whose given date field is <= now. However, for views of something like an events calendar, one needs to display objects whose date field is >= now. Proposed is to add an "upcoming_index", which sorts ascending, for showing future objects, and a "future_ok=False" keyword argument to the "archive_(year, month,day)" and "object_detail" views.

Attachments (1)

django-update.diff (21.1 KB) - added by scaba 13 years ago.

Download all attachments as: .zip

Change History (3)

Changed 13 years ago by scaba

Attachment: django-update.diff added

comment:1 Changed 13 years ago by scaba

For doc updates:

New view:


  • A top-level index page showing the "next upcoming" objects. Has an optional argument, num_upcoming, which is the number of items to display on the page (defaults to 15).
  • Uses the template app_label/module_name_upcoming by default.
  • Has the following template context:


List of years with objects


Upcoming objects by date

Updated views:

archive_year, archive_month, archive_day and object_detail all accept an optional keyword argument future_ok which defaults to False, which is the current behavior of these views.

comment:2 Changed 12 years ago by James Bennett

Resolution: duplicate
Status: newclosed

Superseded by #2433, which has a more up-to-date patch.

Note: See TracTickets for help on using tickets.
Back to Top