Opened 10 years ago

Closed 9 years ago

Last modified 9 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: UI/UX:

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

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by scaba

comment:1 Changed 10 years ago by scaba

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 Changed 9 years ago by ubernostrum

  • Resolution set to duplicate
  • Status changed from new to closed

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

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