Package orm2 :: Package ui :: Package xist :: Module views :: Class xist_form
[hide private]
[frames] | no frames]

Class xist_form

source code

 view --+    
        |    
xist_view --+
            |
           xist_form

Instance Methods [hide private]
  rows(self)
Return a list that contains ll.xist.Node objects and _xist_widget object.
  widgets(self)
Return a list of widgets in this form (i.e.
  set_from_request(self, ignore_if_unset=True)
Call the set_from_request() method of every widget.
  error_message(self, widget, exception)
Return an error message for when widget raised ValidatorException exception.
  __call__(self, errors={}, **kw)

Inherited from xist_view: __getattr__

Inherited from view: __init__, ds


Method Details [hide private]

rows(self)

source code 

Return a list that contains ll.xist.Node objects and _xist_widget object. The nodes will be passed into the form as-is, the widgets will be initialized according to form usage, either with the values from the request+errors (on failed submits), values from the dbobject (display for a modification) or the defaults (for a new dbobject).

This default implementation will return all the widget_specs that are xist widgets from the dbclass.

widgets(self)

source code 
Return a list of widgets in this form (i.e. extract the instances of widget from the result of (rows).

set_from_request(self, ignore_if_unset=True)

source code 

Call the set_from_request() method of every widget. Catch validator
exceptions and process them into error messages using the
error_message() function. Return a dictionary as

   { 'param_name', [ error1, error2, ..., errorn ] }

An empty dict means successful submition ;-)

error_message(self, widget, exception)

source code 
Return an error message for when widget raised ValidatorException exception. This error message will be translated into the user's language by xist.widgets.row() if need be.

__call__(self, errors={}, **kw)
(Call operator)

source code 
None