Opened 18 years ago

Closed 15 years ago

#3895 closed (fixed)

archive_index should have template_object_name

Reported by: marchino <marco.giusti@…> Owned by: nobody
Component: Generic views Version: dev
Severity: Keywords:
Cc: marco.giusti@…, toke-django@… Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

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 (2)

patch.django.date_based (924 bytes ) - added by marchino <marco.giusti@…> 18 years ago.
patch.django_date_based (2.1 KB ) - added by Thomas Kerpe 17 years ago.
Improved Patch against [6147] - added Documentation.

Download all attachments as: .zip

Change History (7)

by marchino <marco.giusti@…>, 18 years ago

Attachment: patch.django.date_based added

by Thomas Kerpe, 17 years ago

Attachment: patch.django_date_based added

Improved Patch against [6147] - added Documentation.

comment:1 by Thomas Kerpe, 17 years ago

Cc: toke-django@… added
Triage Stage: UnreviewedDesign decision needed

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.

comment:2 by Russell Keith-Magee, 17 years ago

Resolution: fixed
Status: newclosed

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

comment:3 by chrisrobison, 15 years ago

Patch needs improvement: set

Using template_object_name in archive_index is said to be fixed, however, I don't believe it is working how it should. I have created a date_based blog and once I assign a template_object_name of 'entry', I then have to change the template to something that seems backwards.

instead of:

{% for entry in latest %}

{% entry.title %}

it must be:

{% for latest in entry %}

{% latest.title %}

This is not consistent with the other date_based templates.

in reply to:  3 comment:4 by chrisrobison, 15 years ago

Resolution: fixed
Status: closedreopened

comment:5 by Alex Gaynor, 15 years ago

Resolution: fixed
Status: reopenedclosed

This bug was fixed 2 years ago, if you think there is a new bug please file a new ticket.

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