tools (xml_tools): split new lines for multi-lines text in XMLUIResult2DataFormResult to be correctly handled in data form
This commit is contained in:
parent
432afa025e
commit
7d8d9c8ccb
1 changed files with 9 additions and 5 deletions
|
|
@ -335,11 +335,15 @@ def XMLUIResult2DataFormResult(xmlui_data):
|
|||
@param xmlui_data (dict): data returned by frontends for XMLUI form
|
||||
@return: dict of data usable by Wokkel's data form
|
||||
"""
|
||||
return {
|
||||
key[len(SAT_FORM_PREFIX) :]: _cleanValue(value)
|
||||
for key, value in xmlui_data.iteritems()
|
||||
if key.startswith(SAT_FORM_PREFIX)
|
||||
}
|
||||
ret = {}
|
||||
for key, value in xmlui_data.iteritems():
|
||||
if not key.startswith(SAT_FORM_PREFIX):
|
||||
continue
|
||||
if isinstance(value, basestring) and u'\n' in value:
|
||||
# data form expects multi-lines text to be in separated values
|
||||
value = value.split(u'\n')
|
||||
ret[key[len(SAT_FORM_PREFIX) :]] = _cleanValue(value)
|
||||
return ret
|
||||
|
||||
|
||||
def formEscape(name):
|
||||
|
|
|
|||
Loading…
Reference in a new issue