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

Class S3GroupedOptionsWidget

source code

??-294 --+
         |
        S3GroupedOptionsWidget


Widget with checkboxes or radio buttons for S3OptionsFilter
- checkboxes can be optionally grouped by letter

Instance Methods
 
__init__(self, options=None, multiple=True, size=None, cols=None, help_field=None, none=None, sort=True, orientation=None, table=True, no_opts=None, option_comment=None)
Constructor
source code
 
__call__(self, field, value, **attributes)
Render this widget
source code
Method Details

__init__(self, options=None, multiple=True, size=None, cols=None, help_field=None, none=None, sort=True, orientation=None, table=True, no_opts=None, option_comment=None)
(Constructor)

source code 

Constructor

Parameters:
  • options - the options for the SELECT, as list of tuples [(value, label)], or as dict {value: label}, or None to auto-detect the options from the Field when called
  • multiple - multiple options can be selected
  • size - maximum number of options in merged letter-groups, None to not group options by initial letter
  • cols - number of columns for the options table
  • help_field - field in the referenced table to retrieve a tooltip text from (for foreign keys only)
  • none - True to render "None" as normal option
  • sort - sort the options (only effective if size==None)
  • orientation - the ordering orientation, "columns"|"rows"
  • table - whether to render options inside a table or not
  • no_opts - text to show if no options available
  • comment - HTML template to render after the LABELs

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

source code 

Render this widget

Parameters:
  • field - the Field
  • value - the currently selected value(s)
  • attributes - HTML attributes for the widget