Commit acebab43 authored by Xiaowu Zhang's avatar Xiaowu Zhang Committed by Cédric Le Ninivin

erp5_hal_json_style: get extra configuration

parent 4fd3d210
......@@ -565,6 +565,9 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None,
"LinesField", "ImageField", "FileField", "IntegerField",
"PasswordField", "EditorField", "HyperLinkField", "LinkField"):
if meta_type in ("StringField", "EmailField"):
extra_dict = field.get_value("extra")
if extra_dict:
result.update(extra_dict)
result.update({
"maxlength": field.get_value("display_maxwidth"),
})
......@@ -603,6 +606,12 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None,
# thus trying to return it to the client, besides being useless, breaks
# the hal API
del result["default"]
if meta_type == "TextAreaField":
extra_dict = field.get_value("extra")
if extra_dict:
result.update(extra_dict)
return result
if meta_type == "DateTimeField":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment