Opened 18 years ago
Closed 15 years ago
#3895 closed (fixed)
archive_index should have template_object_name
Reported by: | 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)
Change History (7)
by , 18 years ago
Attachment: | patch.django.date_based added |
---|
by , 17 years ago
Attachment: | patch.django_date_based added |
---|
comment:1 by , 17 years ago
Cc: | added |
---|---|
Triage Stage: | Unreviewed → Design 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.
method | has template_object_name? | appends _list? |
archive_index | no 1) | no |
archive_year | yes | yes |
archive_month | yes | yes |
archive_week | yes | yes |
archive_day | yes | yes |
object_list | yes | yes |
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 , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
follow-up: 4 comment:3 by , 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.
comment:4 by , 15 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:5 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
This bug was fixed 2 years ago, if you think there is a new bug please file a new ticket.
Improved Patch against [6147] - added Documentation.