Opened 8 years ago

Closed 8 years ago

#4454 closed (invalid)

Tuorial code error ?

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

Description

Hello,

I was reading this intersting documentation about an interesting framework. I am not an expert in Python and I'm not really sure about my suggestion.
On the third page of the Django tutorial : http://www.djangoproject.com/documentation/tutorial03/ in the section "Write views that actually do something", there's the following code :

{% if latest_poll_list %}
    <ul>
    {% for poll in latest_poll_list %}
        <li>{{ poll.question }}</li>
    {% endfor %}
    </ul>
{% else %}
    <p>No polls are available.</p>
{% endif %}

Shouldn't it be :

{% if latest_poll_list %}
    <ul>
    {% for poll in latest_poll_list %}
        <li>{% poll.question %}</li>   <------ Here
    {% endfor %}
    </ul>
{% else %}
    <p>No polls are available.</p>
{% endif %}

Again, I am not an expert but I just want to contribute to community. Please let me know if I was right about my suggestion.

Best regards.
ZENOU Nicolas.

Change History (1)

comment:1 Changed 8 years ago by keegan.csmith@…

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

No.
{{ }} Refer to variables (Values that get put onto the screen, while {% %} refer to tags (Like functions/methods).

Try running the code yourself, and you will see that it works.

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