Code

#19927 closed Bug (invalid)

Tutorial Part 3 - choice.choice_text is choice.choice

Reported by: juril Owned by: nobody
Component: Documentation Version: 1.5-rc-1
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

This applies both to Tutorial Part 3 and 4.

Choice class contains a "choice" field that we want to use when creating a template for its view.

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

should be changed as

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

for the text associated to a choice to be correctly displayed.

Attachments (0)

Change History (1)

comment:1 Changed 14 months ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

You're mixing versions of the tutorial — you started with version 1.4 and continued with version 1.5 (probably).

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.