diff options
| author | Tim Graham <timograham@gmail.com> | 2013-02-02 08:34:42 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-02-02 08:38:02 -0500 |
| commit | f28fbe7314712d3e594a0f6509361378162cc7ea (patch) | |
| tree | a1353ffbd6ab377cb1660da6648ac8877f2bc3d5 /docs | |
| parent | 974909bc9a01ebd3d6f9f938c713ff90e1f41e5a (diff) | |
[1.5.x] Fixed #19700 - Added documentation for BoundField.field.
Thanks Tiberiu Ana for the report and patch.
Backport of fdaaa24171 from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/forms/index.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/docs/topics/forms/index.txt b/docs/topics/forms/index.txt index a3c17e1555..4035fbd9cc 100644 --- a/docs/topics/forms/index.txt +++ b/docs/topics/forms/index.txt @@ -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 message. -``field.is_hidden`` +``{{ field.is_hidden }}`` This attribute is ``True`` if the form field is a hidden field and ``False`` otherwise. It's not particularly useful as a template variable, but could be useful in conditional tests such as:: @@ -345,6 +345,12 @@ attributes, which can be useful in your templates: {# Do something special #} {% 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
