class BoundField: (source)
A Field plus data
Method | __bool__ |
Undocumented |
Method | __getitem__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __len__ |
Undocumented |
Method | __str__ |
Render this field as an HTML widget. |
Method | as |
Return a string of HTML for representing this as an <input type="hidden">. |
Method | as |
Return a string of HTML for representing this as an <input type="text">. |
Method | as |
Return a string of HTML for representing this as a <textarea>. |
Method | as |
Render the field by rendering the passed widget, adding any HTML attributes passed as attrs. If a widget isn't specified, use the field's default widget. |
Method | build |
Undocumented |
Method | css |
Return a string of space-separated CSS classes for this field. |
Method | label |
Wrap the given contents in a <label>, if the field has an ID attribute. contents should be mark_safe'd to avoid HTML escaping. If contents aren't given, use the field's HTML-escaped label. |
Method | legend |
Wrap the given contents in a <legend>, if the field has an ID attribute. Contents should be mark_safe'd to avoid HTML escaping. If contents aren't given, use the field's HTML-escaped label. |
Method | value |
Return the value for this BoundField, using the initial value if the form is not bound or the data otherwise. |
Instance Variable | field |
Undocumented |
Instance Variable | form |
Undocumented |
Instance Variable | help |
Undocumented |
Instance Variable | html |
Undocumented |
Instance Variable | html |
Undocumented |
Instance Variable | html |
Undocumented |
Instance Variable | label |
Undocumented |
Instance Variable | name |
Undocumented |
Property | auto |
Calculate and return the ID attribute for this BoundField, if the associated Form has specified auto_id. Return an empty string otherwise. |
Property | data |
Return the data for this BoundField, or None if it wasn't given. |
Property | errors |
Return an ErrorList (empty if there are no errors) for this field. |
Property | id |
Wrapper around the field widget's `id_for_label` method. Useful, for example, for focusing on this field regardless of whether it has a single widget or a MultiWidget. |
Property | initial |
Undocumented |
Property | is |
Return True if this BoundField's widget is hidden. |
Property | subwidgets |
Most widgets yield a single subwidget, but others like RadioSelect and CheckboxSelectMultiple produce one subwidget for each choice. |
Property | use |
Return the value of this BoundField widget's use_fieldset attribute. |
Property | widget |
Undocumented |
Method | _has |
Undocumented |
Render the field by rendering the passed widget, adding any HTML attributes passed as attrs. If a widget isn't specified, use the field's default widget.
Wrap the given contents in a <label>, if the field has an ID attribute. contents should be mark_safe'd to avoid HTML escaping. If contents aren't given, use the field's HTML-escaped label. If attrs are given, use them as HTML attributes on the <label> tag. label_suffix overrides the form's label_suffix.
Wrap the given contents in a <legend>, if the field has an ID attribute. Contents should be mark_safe'd to avoid HTML escaping. If contents aren't given, use the field's HTML-escaped label. If attrs are given, use them as HTML attributes on the <legend> tag. label_suffix overrides the form's label_suffix.
Return the value for this BoundField, using the initial value if the form is not bound or the data otherwise.
Calculate and return the ID attribute for this BoundField, if the associated Form has specified auto_id. Return an empty string otherwise.
Wrapper around the field widget's `id_for_label` method. Useful, for example, for focusing on this field regardless of whether it has a single widget or a MultiWidget.
Most widgets yield a single subwidget, but others like RadioSelect and CheckboxSelectMultiple produce one subwidget for each choice. This property is cached so that only one database query occurs when rendering ModelChoiceFields.