Django

Code

Ticket #3895 (closed: fixed)

Opened 2 years ago

Last modified 1 year ago

archive_index should have template_object_name

Reported by: marchino <marco.giusti@gmail.com> Assigned to: nobody
Milestone: Component: Generic views
Version: SVN Keywords:
Cc: marco.giusti@gmail.com, toke-django@toke.de Triage Stage: Design decision needed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

generic views archive_index and object_list are logically the same thing: a list of objects so they can use the same template but archive_index uses latest as template_object_name and object_list appends '_list' to it, so it is impossible to do this.

with this small patch is possible to use the same object name with both generic views. maybe you sould look deeper for a more consistency in generic views, i didn't.

Attachments

patch.django.date_based (0.9 kB) - added by marchino <marco.giusti@gmail.com> on 04/01/07 13:02:48.
patch.django_date_based (2.1 kB) - added by toke on 09/13/07 21:40:26.
Improved Patch against [6147] - added Documentation.

Change History

04/01/07 13:02:48 changed by marchino <marco.giusti@gmail.com>

  • attachment patch.django.date_based added.

09/13/07 21:40:26 changed by toke

  • attachment patch.django_date_based added.

Improved Patch against [6147] - added Documentation.

09/13/07 22:17:33 changed by toke

  • cc changed from marco.giusti@gmail.com to marco.giusti@gmail.com, toke-django@toke.de.
  • needs_better_patch changed.
  • stage changed from Unreviewed to Design decision needed.
  • needs_tests changed.
  • needs_docs changed.

archive_index and object_list are not completly interchangable of course. Also there is the issue with appending _list to template_object_name. archive_index is somewhat inconsistent with that.

methodhas template_object_name?appends _list?
archive_indexno 1)no
archive_yearyesyes
archive_monthyesyes
archive_weekyesyes
archive_dayyesyes
object_listyesyes

1) Patch will fix this

How to address the appending of _list without breaking something? Adding it only if template_object_name was set is not consistent.

09/13/07 22:54:29 changed by russellm

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

(In [6157]) Fixed #3895 -- Added ability to customize the context variable in the archive_index generic view. Thanks to marco.giusti@gmail.com and toke-django@toke.de.


Add/Change #3895 (archive_index should have template_object_name)




Change Properties
Action