display labels for visible fields only

This commit is contained in:
Serghei Mihai 2015-04-29 20:31:27 +02:00
parent 7d4c9d71fd
commit cecc851b39
1 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,5 @@
{{ form.non_field_errors }}
{% for field in form %}
{% for field in form.visible_fields %}
<div id="id_{{ field.html_name }}_wrap" class="{% if field.field.required %} form-field-required{% endif %}{% if field.errors %} form-field-error{% endif %}">
{{ field.errors }}
<label for="id_{{ field.html_name }}">{{ field.label }}&nbsp;:</label>
@ -9,3 +9,6 @@
{% endif %}
</div>
{% endfor %}
{% for hidden in form.hidden_fields %}
{{ hidden }}
{% endfor %}