Package turbogears :: Package widgets :: Module meta
[hide private]

Module meta

source code

Classes [hide private]
  MetaWidget
  ParamDescriptor
Descriptor to support automatic callable support for widget params.
  NullValidator
A do-nothing validator.
Functions [hide private]
 
lockwidget(self, *args, **kw)
Sets this widget as locked the first time it's displayed.
source code
 
_decorate_widget_init(func)
Ensures that the display method for the instance is overridden by lockwidget, that an eventual validator dict is applied to the widget validator and that a validation schema is generated for compound widgets.
source code
 
load_kid_template(t, modname=None)
Loads the given template into the given module name, if modname is None, an unique one will be generated.
source code
 
copy_schema(schema)
recursively copies a schema
source code
 
merge_schemas(to_schema, from_schema, inplace=False)
Recursively merges from_schema into to_schema taking care of leaving to_schema intact if inplace is False (default).
source code
 
add_field_to_schema(schema, widget)
Adds a widget's validator if any to the given schema
source code
 
generate_schema(schema, widgets)
Generates or extends a copy of schema with all the validators from the widget in the widgets list.
source code
 
can_add_field(schema, field_name)
Checks if we can safely add a field.
source code
Variables [hide private]
  param_prefix = '_param_'
  widget_instance_serial = count(1)
Function Details [hide private]

load_kid_template(t, modname=None)

source code 

Loads the given template into the given module name, if modname is None, an unique one will be generated. Returns a tuple (compiled_tmpl, template_text (or modulepath)

can_add_field(schema, field_name)

source code 

Checks if we can safely add a field. Makes sure we're not overriding any field in the Schema. NullValidators are ok to override.