Opened 12 years ago

Closed 12 years ago

#18851 closed Uncategorized (invalid)

Error in documentation

Reported by: ctigeek@… Owned by: nobody
Component: Documentation Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

https://docs.djangoproject.com/en/1.4/intro/tutorial03/#use-the-template-system

Code example has "choice.choice" in FOR loop, it should just be "choice".

CURRENT (INCORRECT):

  <h1>{{ poll.question }}</h1>
<ul>
{% for choice in poll.choice_set.all %}
    <li>{{ choice.choice }}</li>
{% endfor %}
</ul>

CORRECT:

  <h1>{{ poll.question }}</h1>
<ul>
{% for choice in poll.choice_set.all %}
    <li>{{ choice }}</li>
{% endfor %}
</ul>

Change History (1)

comment:1 by Tim Graham, 12 years ago

Resolution: invalid
Status: newclosed

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

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