Commit 6fcdcbd4 authored by Simon Willison's avatar Simon Willison
Browse files

Clarified the wording of the section on customizing form.errors within a field loop

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9032 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 5389c0d2
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -267,12 +267,9 @@ reduce duplicate code by looping through each field in turn using
        <p><input type="submit" value="Send message"></p>
    </form>

As in the above example, {{ field.errors }} will output a 
``<ul class="errorlist">`` by default. You can further customise the display
of errors with a ``{% for error in field.errors %}`` loop.

Within this loop, ``{{ field }}`` is an instance of BoundField. BoundField 
also has the following attributes which can be useful in your templates:
Within this loop, ``{{ field }}`` is an instance of :class:`BoundField`.
``BoundField`` also has the following attributes which can be useful in your 
templates:

    ``{{ field.label }}``
        The label of the field, e.g. ``Name``.
@@ -288,6 +285,11 @@ also has the following attributes which can be useful in your templates:
    ``{{ field.help_text }}``
        Any help text that has been associated with the field.
    
    ``{{ field.errors }}``
        Outputs a ``<ul class="errorlist">`` containing any validation errors
        corresponding to this field. You can customize the presentation of 
        the errors with a ``{% for error in field.errors %}`` loop.

Further topics
==============