tools (xml_tools): handle required field in dataDict2dataForm:
rel 372
This commit is contained in:
parent
7793a482a2
commit
97c0d6a0e5
1 changed files with 2 additions and 0 deletions
|
|
@ -259,6 +259,7 @@ def dataDict2dataForm(data_dict):
|
||||||
- "xhtml" is used for "xml" fields with child in the C.NS_XHTML namespace
|
- "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"
|
- "options" are list of dict with optional "label" and mandatory "value"
|
||||||
following suitable attributes from data_form.Option
|
following suitable attributes from data_form.Option
|
||||||
|
- "required" is the same as data_form.Field.required
|
||||||
"""
|
"""
|
||||||
# TODO: describe format
|
# TODO: describe format
|
||||||
fields = []
|
fields = []
|
||||||
|
|
@ -269,6 +270,7 @@ def dataDict2dataForm(data_dict):
|
||||||
"var": field_data["name"],
|
"var": field_data["name"],
|
||||||
"label": field_data.get('label'),
|
"label": field_data.get('label'),
|
||||||
"value": field_data.get("value"),
|
"value": field_data.get("value"),
|
||||||
|
"required": field_data.get("required")
|
||||||
}
|
}
|
||||||
if field_type == "xhtml":
|
if field_type == "xhtml":
|
||||||
kwargs.update({
|
kwargs.update({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue