core (XMLUI): form's XMLUI is use as first arguments for filters in dataForm2Widgets

This commit is contained in:
Goffi 2017-11-11 18:39:26 +01:00
commit c336351115

View file

@ -113,8 +113,8 @@ def dataForm2Widgets(form_ui, form, read_only=False, prepend=None, filters=None)
be added first to the container.
@param filters(dict, None): if not None, a dictionary of callable:
key is the name of the widget to filter
the value is a callable, it will get widget's type, args and kwargs
and must return the same variable, which it can modify
the value is a callable, it will get form's XMLUI, widget's type, args and kwargs
and must return widget's type, args and kwargs (which can be modified)
This is especially useful to modify well known fields
@return: the completed XMLUI instance
"""
@ -136,7 +136,7 @@ def dataForm2Widgets(form_ui, form, read_only=False, prepend=None, filters=None)
except KeyError:
pass
else:
widget_type, widget_args, widget_kwargs = widget_filter(widget_type, widget_args, widget_kwargs)
widget_type, widget_args, widget_kwargs = widget_filter(form_ui, widget_type, widget_args, widget_kwargs)
label = field.label or field.var
if label:
form_ui.addLabel(label)