Opened 12 years ago
Closed 12 years ago
#18693 closed Uncategorized (invalid)
Minor bug in tutorial part 3
Reported by: | mpwoodward | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.4 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
Brand new to Django and I'm going through your excellent tutorial, and unless I missed a step there is a small bug in the code in part 3 of the tutorial here:
https://docs.djangoproject.com/en/1.4/intro/tutorial03/
Specifically, this chunk under the heading "Use the template system":
<h1>{{ poll.question }}</h1> <ul> {% for choice in poll.choice_set.all %} <li>{{ choice.choice }}</li> {% endfor %} </ul>
Unless I'm mistaken in the loop it should be choice.choice_text instead of choice.choice. When I changed it to choice.choice_text the choice text appeared in the output.
Change History (2)
comment:1 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 12 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Actually, this looks correct to me. On the 1.4 branch the Choice model is declared with a "choice" field while it was changed to "choice_text" in the dev branch (1.5). Perhaps you started on the dev branch for step 1 of the tutorial and ended up on the 1.4 branch for step 3?
Broken in commit 45284a90a515e71552f37c539a3cfdc38f15d869