#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 , 12 years ago
| Cc: | added | 
|---|---|
| Easy pickings: | set | 
| Summary: | Mis-typing in description of tutorial 04 → Clarify the usage of template_name in tutorial part 4 | 
| Triage Stage: | Unreviewed → Accepted | 
| Type: | Uncategorized → Cleanup/optimization | 
| Version: | 1.5 → master | 
comment:2 by , 12 years ago
| Resolution: | → fixed | 
|---|---|
| Status: | new → closed | 
  Note:
 See   TracTickets
 for help on using tickets.
    
Hi,
The sentence is technically correct: by default, a
DetailViewwill use<app name>/<model name>_detail.html, as noted in the previous sentence. In the context of the example, that would bepolls/poll_detail.html.This is the name of the template that would be used if we didn't define the
template_nameattribute 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.