#18828 closed Bug (invalid)
Tutorial Code/Syntax Error
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | 1.4 |
Severity: | Normal | Keywords: | erorr, typo, syntax |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In the tutorial part 04, from the example code given for the “polls/detail.html” file, I believe:
<label for="choice{{ forloop.counter }}">{{ choice.choice }}</label><br />
Should simply be:
<label for="choice{{ forloop.counter }}">{{ choice }}</label><br />
This is also the case for the “polls/results.html” where:
<li>{{ choice.choice }} -- {{ choice.votes }} vote{{ choice.votes|pluralize }}</li>
Should be:
<li>{{ choice }} -- {{ choice.votes }} vote{{ choice.votes|pluralize }}</li>
Thank you for putting up such good documentaries!
I really value being able to learn things like this online. Thanks so much, I love Django.
Change History (3)
comment:1 by , 12 years ago
Type: | Uncategorized → Bug |
---|
follow-up: 3 comment:2 by , 12 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:3 by , 12 years ago
Replying to timo:
You are probably mixing versions of the tutorial. choice.choice has been renamed choice.choice_text in the development version of the tutorial.
Oh, I thought I had been using version 1.4 the whole time.
"choice.choice" wouldn't work, but just "choice" is working.
Maybe I did something else wrong, but it works for me now.
You are probably mixing versions of the tutorial. choice.choice has been renamed choice.choice_text in the development version of the tutorial.