Package s3 :: Module s3widgets :: Class S3HierarchyWidget
[frames] | no frames]

Class S3HierarchyWidget

source code

??-282 --+
         |
        S3HierarchyWidget

Selector Widget for Hierarchies

Instance Methods
 
__init__(self, lookup=None, represent=None, multiple=True, leafonly=True, cascade=False, bulk_select=False, filter=None, columns=None, none=None)
Constructor
source code
 
__call__(self, field, value, **attr)
Widget renderer
source code
 
parse(self, value)
Value parser for the hidden input field of the widget
source code
Method Details

__init__(self, lookup=None, represent=None, multiple=True, leafonly=True, cascade=False, bulk_select=False, filter=None, columns=None, none=None)
(Constructor)

source code 

Constructor

Parameters:
  • lookup - name of the lookup table (must have a hierarchy configured)
  • represent - alternative representation method (falls back to the field's represent-method)
  • multiple - allow selection of multiple options
  • leafonly - True = only leaf nodes can be selected (with multiple=True: selection of a parent node will automatically select all leaf nodes of that branch) False = any nodes can be selected independently
  • cascade - automatic selection of children when selecting a parent node (if leafonly=False, otherwise this is the standard behavior!), requires multiple=True
  • bulk_select - provide option to select/deselect all nodes
  • filter - filter query for the lookup table
  • columns - set the columns width class for Foundation forms
  • none - label for an option that delivers "None" as value (useful for HierarchyFilters with explicit none-selection)

__call__(self, field, value, **attr)
(Call operator)

source code 

Widget renderer

Parameters:
  • field - the Field
  • value - the current value(s)
  • attr - additional HTML attributes for the widget

parse(self, value)

source code 

Value parser for the hidden input field of the widget

Parameters:
  • value - the value received from the client, JSON string
Returns:
a list (if multiple=True) or the value