Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.5.x] Fixed #19700 - Added documentation for BoundField.field.

Thanks Tiberiu Ana for the report and patch.

Backport of fdaaa24 from master
  • Loading branch information...
commit f28fbe7314712d3e594a0f6509361378162cc7ea 1 parent 974909b
Tim Graham authored

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. 8  docs/topics/forms/index.txt
8  docs/topics/forms/index.txt
@@ -336,7 +336,7 @@ attributes, which can be useful in your templates:
336 336
     case, each object in the loop is a simple string containing the error
337 337
     message.
338 338
 
339  
-``field.is_hidden``
  339
+``{{ field.is_hidden }}``
340 340
     This attribute is ``True`` if the form field is a hidden field and
341 341
     ``False`` otherwise. It's not particularly useful as a template
342 342
     variable, but could be useful in conditional tests such as::
@@ -345,6 +345,12 @@ attributes, which can be useful in your templates:
345 345
            {# Do something special #}
346 346
         {% endif %}
347 347
 
  348
+``{{ field.field }}``
  349
+    The :class:`~django.forms.Field` instance from the form class that
  350
+    this :class:`~django.forms.BoundField` wraps. You can use it to access
  351
+    :class:`~django.forms.Field` attributes , e.g.
  352
+    ``{{ char_field.field.max_length }}``.
  353
+
348 354
 Looping over hidden and visible fields
349 355
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
350 356
 

0 notes on commit f28fbe7

Please sign in to comment.
Something went wrong with that request. Please try again.