diff sat/tools/xml_tools.py @ 2958:e2cb04b381bb

tools (xml_tools): added "read_only" argument in dataFormResult2XMLUI (and use it in plugin pubsub_schema)
author Goffi <goffi@goffi.org>
date Wed, 12 Jun 2019 09:11:28 +0200
parents 48985ef7682f
children ab2696e34d29
line wrap: on
line diff
--- a/sat/tools/xml_tools.py	Sun May 26 22:30:09 2019 +0200
+++ b/sat/tools/xml_tools.py	Wed Jun 12 09:11:28 2019 +0200
@@ -287,9 +287,8 @@
     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 @@
     @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 @@
             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