Opened 18 years ago
Closed 18 years ago
#4454 closed (invalid)
Tuorial code error ?
Reported by: | Owned by: | Jacob | |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | 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
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.
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.