Opened 19 years ago

Closed 18 years ago

Last modified 18 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

Description

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 19 years ago.

Download all attachments as: .zip

Change History (3)

by scaba, 19 years ago

Attachment: django-update.diff added

comment:1 by scaba, 19 years ago

For doc updates:

New view:

upcoming_index

  • 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:

date_list

List of years with objects

upcoming

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 by James Bennett, 18 years ago

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