Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#18828 closed Bug (invalid)

Tutorial Code/Syntax Error

Reported by: knightxthyme@… 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 anonymous, 12 years ago

Type: UncategorizedBug

comment:2 by Tim Graham, 12 years ago

Resolution: invalid
Status: newclosed

You are probably mixing versions of the tutorial. choice.choice has been renamed choice.choice_text in the development version of the tutorial.

in reply to:  2 comment:3 by anonymous, 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.

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