Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#19451 closed Cleanup/optimization (invalid)

Scripting error on Django tutorial

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

Description

I think there is a mistake in the step 3 of the tutorial.

I the part that reads:


Use the template system

Back to the detail() view for our poll application. Given the context variable poll, here's what the polls/detail.html template might look like:

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

I think the part that reads "<li>{{ choice.choice_text }}</li>" should be "<li>{{ choice.choice }}</li>"; since the change is not mentioned before and the attribute "choice" itself contains the "choice text".

Thanks.

Change History (3)

comment:1 Changed 3 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 3 years ago by aaugustin

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

You're probably mixing versions of the tutorial. This part changed between Django 1.4 and 1.5.

There's a version switcher at the bottom right of each page of the tutorial. Make sure you're always reading the version that matches the version of Django you're using.

comment:3 Changed 3 years ago by Ganiserb

You are right! I opened step 1 from a link in the Google search results and it was different than getting there manually from the Django docs page and selecting "dev" version for the 1st step.

Thanks and sorry for the confusion.

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