Kaydet (Commit) fdaaa241 authored tarafından Tim Graham's avatar Tim Graham

Fixed #19700 - Added documentation for BoundField.field.

Thanks Tiberiu Ana for the report and patch.
üst a1c470a6
...@@ -336,7 +336,7 @@ attributes, which can be useful in your templates: ...@@ -336,7 +336,7 @@ attributes, which can be useful in your templates:
case, each object in the loop is a simple string containing the error case, each object in the loop is a simple string containing the error
message. message.
``field.is_hidden`` ``{{ field.is_hidden }}``
This attribute is ``True`` if the form field is a hidden field and This attribute is ``True`` if the form field is a hidden field and
``False`` otherwise. It's not particularly useful as a template ``False`` otherwise. It's not particularly useful as a template
variable, but could be useful in conditional tests such as:: variable, but could be useful in conditional tests such as::
...@@ -345,6 +345,12 @@ attributes, which can be useful in your templates: ...@@ -345,6 +345,12 @@ attributes, which can be useful in your templates:
{# Do something special #} {# Do something special #}
{% endif %} {% endif %}
``{{ field.field }}``
The :class:`~django.forms.Field` instance from the form class that
this :class:`~django.forms.BoundField` wraps. You can use it to access
:class:`~django.forms.Field` attributes , e.g.
``{{ char_field.field.max_length }}``.
Looping over hidden and visible fields Looping over hidden and visible fields
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment