From c336351115d7592965d6d11a3b137dece7f81e90 Mon Sep 17 00:00:00 2001 From: Goffi Date: Sat, 11 Nov 2017 18:39:26 +0100 Subject: [PATCH] core (XMLUI): form's XMLUI is use as first arguments for filters in dataForm2Widgets --- src/tools/xml_tools.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/xml_tools.py b/src/tools/xml_tools.py index 8b43d5bd..bacb7615 100644 --- a/src/tools/xml_tools.py +++ b/src/tools/xml_tools.py @@ -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)