Opened 4 years ago

Closed 4 years ago

Last modified 4 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 Changed 4 years ago by anonymous

Type: UncategorizedBug

comment:2 Changed 4 years ago by Tim Graham

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.

comment:3 in reply to:  2 Changed 4 years ago by anonymous

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