# HG changeset patch # User Goffi # Date 1663793035 -7200 # Node ID 384b7e6c2dbf1828ec5886dcbf1d55e389befcfb # Parent 32b38dd3ac18c70e81eea39ab93b0c435997cadb tools (xml_tools): handle `required` field in `dataDict2dataForm`: rel 372 diff -r 32b38dd3ac18 -r 384b7e6c2dbf sat/tools/xml_tools.py --- a/sat/tools/xml_tools.py Wed Sep 21 22:41:49 2022 +0200 +++ b/sat/tools/xml_tools.py Wed Sep 21 22:43:55 2022 +0200 @@ -259,6 +259,7 @@ - "xhtml" is used for "xml" fields with child in the C.NS_XHTML namespace - "options" are list of dict with optional "label" and mandatory "value" following suitable attributes from data_form.Option + - "required" is the same as data_form.Field.required """ # TODO: describe format fields = [] @@ -269,6 +270,7 @@ "var": field_data["name"], "label": field_data.get('label'), "value": field_data.get("value"), + "required": field_data.get("required") } if field_type == "xhtml": kwargs.update({