tools (xml_tools): handle required field in dataDict2dataForm:

rel 372
This commit is contained in:
Goffi 2022-09-21 22:43:55 +02:00
commit 97c0d6a0e5

View file

@ -259,6 +259,7 @@ def dataDict2dataForm(data_dict):
- "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 @@ def dataDict2dataForm(data_dict):
"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({