tools (xml_tools): added "read_only" argument in dataFormResult2XMLUI (and use it in plugin pubsub_schema)
This commit is contained in:
parent
f6ceaf8fde
commit
0f97a75f6f
2 changed files with 5 additions and 4 deletions
|
|
@ -311,6 +311,7 @@ class PubsubSchema(object):
|
|||
("text", item_elt.getAttribute("publisher", ""), u"publisher"),
|
||||
),
|
||||
filters=filters,
|
||||
read_only=False,
|
||||
)
|
||||
items_xmlui.append(xmlui)
|
||||
break
|
||||
|
|
|
|||
|
|
@ -287,9 +287,8 @@ def dataFormEltResult2XMLUI(form_elt, session_id=None):
|
|||
return xml_ui
|
||||
|
||||
|
||||
def dataFormResult2XMLUI(
|
||||
result_form, base_form, session_id=None, prepend=None, filters=None
|
||||
):
|
||||
def dataFormResult2XMLUI(result_form, base_form, session_id=None, prepend=None,
|
||||
filters=None, read_only=True):
|
||||
"""Convert data form result to SàT XMLUI.
|
||||
|
||||
@param result_form (data_form.Form): result form to convert
|
||||
|
|
@ -298,6 +297,7 @@ def dataFormResult2XMLUI(
|
|||
@param session_id (unicode): session id to return with the data
|
||||
@param prepend: same as for [dataForm2Widgets]
|
||||
@param filters: same as for [dataForm2Widgets]
|
||||
@param read_only: same as for [dataForm2Widgets]
|
||||
@return: XMLUI instance
|
||||
"""
|
||||
# we deepcopy the form because _dataFormField2XMLUIData can modify the value
|
||||
|
|
@ -312,7 +312,7 @@ def dataFormResult2XMLUI(
|
|||
continue
|
||||
field.options = base_field.options[:]
|
||||
xml_ui = XMLUI("window", "vertical", session_id=session_id)
|
||||
dataForm2Widgets(xml_ui, form, read_only=True, prepend=prepend, filters=filters)
|
||||
dataForm2Widgets(xml_ui, form, read_only=read_only, prepend=prepend, filters=filters)
|
||||
return xml_ui
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue