1
0
mirror of https://github.com/django/django.git synced 2024-12-23 09:36:06 +00:00

Fixed #16815 -- Rectified the code example for hidden_fields and visible_fields in the forms documentation. Thanks, joonas.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16823 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Julien Phalip 2011-09-13 08:22:53 +00:00
parent c76112cf1d
commit 3513234cf8

View File

@ -333,16 +333,13 @@ and visible fields independently: ``hidden_fields()`` and
these two methods::
<form action="/contact/" method="post">
{# Include the hidden fields #}
{% for hidden in form.hidden_fields %}
{{ hidden }}
{% endfor %}
{# Include the visible fields #}
{% for field in form.visible_fields %}
<div class="fieldWrapper">
{# Include the hidden fields in the form #}
{% if forloop.first %}
{% for hidden in form.hidden_fields %}
{{ hidden }}
{% endfor %}
{% endif %}
{{ field.errors }}
{{ field.label_tag }}: {{ field }}
</div>