Opened 3 years ago

Closed 3 years ago

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

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Type changed from Uncategorized to Bug

comment:2 follow-up: Changed 3 years ago by timo

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

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 3 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