Code

Opened 6 years ago

Closed 5 years ago

#10009 closed (fixed)

Wrong variable name in example (page "Working with forms")

Reported by: karihre@… Owned by: nobody
Component: Documentation Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

In the "Working with forms" (http://docs.djangoproject.com/en/dev/topics/forms/) page the third example from the bottom has a wrong variable in one place. The relevant code in the example is:

            {% if forloop.first %}
                {% for hidden in form.hidden_fields %}
                {{ field }}
                {% endfor %}
            {% endif %}

Instead of {{ field }} it should read {{ hidden }} (unless I am much mistaken).

Thanks for all your hard work!

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by SmileyChris

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

Yep, either this fix, or I'd be more inclined to change the first line to {% for field in form.hidden_fields %}
I'll let the committer decide

comment:2 Changed 5 years ago by russellm

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

(In [9862]) Fixed #10009 -- Corrected a field reference in an example on rendering hidden fields. Thanks to karihre@… for the report.

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.