Changes between Initial Version and Version 1 of Ticket #25481
- Timestamp:
- Sep 28, 2015, 12:48:16 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #25481
- Property Triage Stage Unreviewed → Accepted
- Property Type Uncategorized → Cleanup/optimization
-
TabularUnified Ticket #25481 – Description
initial v1 1 1 On https://docs.djangoproject.com/en/dev/topics/forms/#looping-over-the-form-s-fields 2 2 3 the example of looping over the form's fields omits {{ field.help_text }}, though this field is outputted by default by {{ form.as_ul }}. I believe we should add {{ field.help_text }} in the example to be both consistent and complete. 4 5 In addition, but not related, {{ field.errors }} might need a span for the example to be usable in real life. 3 The example of looping over the form's fields omits `{{ field.help_text }}`, though this field is outputted by default by `{{ form.as_ul }}`. I believe we should add `{{ field.help_text }}` in the example to be both consistent and complete. 6 4 7 5 From the docs: 8 6 --- 9 Looping over the form’s fields ¶7 Looping over the form’s fields 10 8 11 9 If you’re using the same HTML for each of your form fields, you can reduce duplicate code by looping through each field in turn using a {% for %} loop: 12 13 10 14 11 {{{ … … 19 16 </div> 20 17 {% endfor %} 21 22 {% for field in form %}23 <div class="fieldWrapper">24 {{ field.errors }}25 {{ field.label_tag }} {{ field }}26 </div>27 {% endfor %}28 18 }}}