#25481: Documentation: Add field.help_text to looping over a form's fields
-------------------------------+--------------------
     Reporter:  wimfeijen      |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Documentation  |    Version:  master
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  1              |      UI/UX:  0
-------------------------------+--------------------
 On https://docs.djangoproject.com/en/dev/topics/forms/#looping-over-the-
 form-s-fields

 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.

 In addition, but not related, {{ field.errors }} might need a span for the
 example to be usable in real life.

 From the docs:
 ---
 Looping over the form’s fields¶

 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:


 {{{
 {% for field in form %}
     <div class="fieldWrapper">
         {{ field.errors }}
         {{ field.label_tag }} {{ field }}
     </div>
 {% endfor %}

 {% for field in form %}
     <div class="fieldWrapper">
         {{ field.errors }}
         {{ field.label_tag }} {{ field }}
     </div>
 {% endfor %}
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25481>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.370cdcf2f6e286fa8ab1176485032d92%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to