Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#21195 closed Cleanup/optimization (fixed)

Clarify the usage of template_name in tutorial part 4

Reported by: anonymous Owned by: nobody
Component: Documentation Version: dev
Severity: Normal Keywords: poll_detail.html
Cc: bmispelon@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Search in https://docs.djangoproject.com/en/1.5/intro/tutorial04/
for the text: "In our case, it’ll use the template "polls/poll_detail.html". <- "poll_detail.html" should be just "detail.html"

Change History (3)

comment:1 by Baptiste Mispelon, 11 years ago

Cc: bmispelon@… added
Easy pickings: set
Summary: Mis-typing in description of tutorial 04Clarify the usage of template_name in tutorial part 4
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization
Version: 1.5master

Hi,

The sentence is technically correct: by default, a DetailView will use <app name>/<model name>_detail.html, as noted in the previous sentence. In the context of the example, that would be polls/poll_detail.html.

This is the name of the template that would be used if we didn't define the template_name attribute on the view.

So, while the sentence is correct, I agree with you that it can be a bit confusing. Maybe using a conditional form would make it clearer: "In our case, it would use the template "polls/poll_detail.html".
What do you think?

Thanks for your report.

comment:2 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: newclosed

In b66a51ad545ac726ef98966cbc35ee7aefdff8cd:

Fixed #21195 -- Clarifed usage of template_name in tutorial part 4.

comment:3 by Baptiste Mispelon <bmispelon@…>, 11 years ago

In b8713ee69a7a171a01cf94c56d3b83bc09e41506:

[1.4.x] Fixed #21195 -- Clarifed usage of template_name in tutorial part 4.

Backport of b66a51ad545ac726ef98966cbc35ee7aefdff8cd from master.

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