Opened 22 months ago

Closed 22 months ago

Last modified 17 months 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: master
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 Changed 22 months ago by bmispelon

  • Cc bmispelon@… added
  • Easy pickings set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from Mis-typing in description of tutorial 04 to Clarify the usage of template_name in tutorial part 4
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Uncategorized to Cleanup/optimization
  • Version changed from 1.5 to master

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 Changed 22 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In b66a51ad545ac726ef98966cbc35ee7aefdff8cd:

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

comment:3 Changed 17 months ago by Baptiste Mispelon <bmispelon@…>

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