Package django :: Package newforms :: Module forms :: Class BoundField
[hide private]
[frames] | no frames]

Class BoundField

source code

                  object --+    
                           |    
utils.encoding.StrAndUnicode --+
                               |
                              BoundField

A Field plus data

Instance Methods [hide private]
 
__init__(self, form, field, name)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__unicode__(self)
Renders this field as an HTML widget.
source code
 
_errors(self)
Returns an ErrorList for this field.
source code
 
as_widget(self, widget=None, attrs=None)
Renders the field by rendering the passed widget, adding any HTML attributes passed as attrs.
source code
 
as_text(self, attrs=None)
Returns a string of HTML for representing this as an <input type="text">.
source code
 
as_textarea(self, attrs=None)
Returns a string of HTML for representing this as a <textarea>.
source code
 
as_hidden(self, attrs=None)
Returns a string of HTML for representing this as an <input type="hidden">.
source code
 
_data(self)
Returns the data for this BoundField, or None if it wasn't given.
source code
 
label_tag(self, contents=None, attrs=None)
Wraps the given contents in a <label>, if the field has an ID attribute.
source code
 
_is_hidden(self)
Returns True if this BoundField's widget is hidden.
source code
 
_auto_id(self)
Calculates and returns the ID attribute for this BoundField, if the associated Form has specified auto_id.
source code

Inherited from utils.encoding.StrAndUnicode: __str__

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Properties [hide private]
  errors
Returns an ErrorList for this field.
  data
Returns the data for this BoundField, or None if it wasn't given.
  is_hidden
Returns True if this BoundField's widget is hidden.
  auto_id
Calculates and returns the ID attribute for this BoundField, if the associated Form has specified auto_id.

Inherited from object: __class__

Method Details [hide private]

__init__(self, form, field, name)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

_errors(self)

source code 

Returns an ErrorList for this field. Returns an empty ErrorList if there are none.

as_widget(self, widget=None, attrs=None)

source code 

Renders the field by rendering the passed widget, adding any HTML attributes passed as attrs. If no widget is specified, then the field's default widget will be used.

label_tag(self, contents=None, attrs=None)

source code 

Wraps the given contents in a <label>, if the field has an ID attribute. Does not HTML-escape the contents. If contents aren't given, uses the field's HTML-escaped label.

If attrs are given, they're used as HTML attributes on the <label> tag.

_auto_id(self)

source code 

Calculates and returns the ID attribute for this BoundField, if the associated Form has specified auto_id. Returns an empty string otherwise.


Property Details [hide private]

errors

Returns an ErrorList for this field. Returns an empty ErrorList if there are none.

Get Method:
_errors(self) - Returns an ErrorList for this field.

data

Returns the data for this BoundField, or None if it wasn't given.

Get Method:
_data(self) - Returns the data for this BoundField, or None if it wasn't given.

is_hidden

Returns True if this BoundField's widget is hidden.

Get Method:
_is_hidden(self) - Returns True if this BoundField's widget is hidden.

auto_id

Calculates and returns the ID attribute for this BoundField, if the associated Form has specified auto_id. Returns an empty string otherwise.

Get Method:
_auto_id(self) - Calculates and returns the ID attribute for this BoundField, if the associated Form has specified auto_id.