Opened 12 years ago

Closed 12 years ago

#18560 closed Bug (invalid)

polls/detail.html Demo Code in Django 1.4 Tutorial is Incorrect?

Reported by: Benjamin E White 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

If I'm not mistaken, the demo code for polls/detail.html is incorrect.

This:

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

When I view this at http://127.0.0.1:8000/polls/1/, it gives me the appropriate header, but the bullets are blank (i can see the bullets but no text).

My bulleted lists appear as expected after making this modification, which is in line with the model described here in the first part of the tutorial:

  <li>{{ choice.choice_text }}</li>

Change History (2)

comment:1 by Benjamin E White, 12 years ago

Same issue here, with same fix.

comment:2 by Claude Paroz, 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.

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