Django

Code

Ticket #608 (closed: duplicate)

Opened 3 years ago

Last modified 2 years ago

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

Reported by: scaba Assigned to: jacob
Milestone: Component: Generic views
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

django-update.diff (21.1 kB) - added by scaba on 10/10/05 17:21:33.

Change History

10/10/05 17:21:33 changed by scaba

  • attachment django-update.diff added.

10/10/05 17:31:51 changed 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.

07/26/06 20:23:56 changed by ubernostrum

  • status changed from new to closed.
  • resolution set to duplicate.

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


Add/Change #608 (Allow objects with future dates to display in date based generic views)




Change Properties
Action