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

Class BaseForm

source code

                  object --+    
                           |    
utils.encoding.StrAndUnicode --+
                               |
                              BaseForm
Known Subclasses:

Instance Methods [hide private]
 
__init__(self, data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.newforms.util.ErrorList'>, label_suffix=':')
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__unicode__(self) source code
 
__iter__(self) source code
 
__getitem__(self, name)
Returns a BoundField with the given name.
source code
 
_get_errors(self)
Returns an ErrorDict for the data provided for the form
source code
 
is_valid(self)
Returns True if the form has no errors.
source code
 
add_prefix(self, field_name)
Returns the field name with a prefix appended, if this Form has a prefix set.
source code
 
_html_output(self, normal_row, error_row, row_ender, help_text_html, errors_on_separate_row)
Helper function for outputting HTML.
source code
 
as_table(self)
Returns this form rendered as HTML <tr>s -- excluding the <table></table>.
source code
 
as_ul(self)
Returns this form rendered as HTML <li>s -- excluding the <ul></ul>.
source code
 
as_p(self)
Returns this form rendered as HTML <p>s.
source code
 
non_field_errors(self)
Returns an ErrorList of errors that aren't associated with a particular field -- i.e., from Form.clean().
source code
 
full_clean(self)
Cleans all of self.data and populates self._errors and self.cleaned_data.
source code
 
clean(self)
Hook for doing any extra form-wide cleaning after Field.clean() been called on every field.
source code
 
is_multipart(self)
Returns True if the form needs to be multipart-encrypted, i.e.
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 ErrorDict for the data provided for the form

Inherited from object: __class__

Method Details [hide private]

__init__(self, data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.newforms.util.ErrorList'>, label_suffix=':')
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

is_valid(self)

source code 

Returns True if the form has no errors. Otherwise, False. If errors are being ignored, returns False.

add_prefix(self, field_name)

source code 

Returns the field name with a prefix appended, if this Form has a prefix set.

Subclasses may wish to override.

_html_output(self, normal_row, error_row, row_ender, help_text_html, errors_on_separate_row)

source code 

Helper function for outputting HTML. Used by as_table(), as_ul(), as_p().

non_field_errors(self)

source code 

Returns an ErrorList of errors that aren't associated with a particular field -- i.e., from Form.clean(). Returns an empty ErrorList if there are none.

clean(self)

source code 

Hook for doing any extra form-wide cleaning after Field.clean() been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named '__all__'.

is_multipart(self)

source code 

Returns True if the form needs to be multipart-encrypted, i.e. it has FileInput. Otherwise, False.


Property Details [hide private]

errors

Returns an ErrorDict for the data provided for the form

Get Method:
_get_errors(self) - Returns an ErrorDict for the data provided for the form