0002-fields-in-export_to_xml-handle-non-string-value-for-.patch
wcs/fields.py | ||
---|---|---|
177 | 177 |
el = ET.SubElement(field, attribute) |
178 | 178 |
if type(val) is dict: |
179 | 179 |
for k, v in val.items(): |
180 |
ET.SubElement(el, k).text = unicode(v, charset, 'replace') |
|
180 |
if isinstance(v, str): |
|
181 |
text_value = unicode(v, charset, 'replace') |
|
182 |
else: |
|
183 |
# field having non str value |
|
184 |
# in dictionnary field must |
|
185 |
# overloaf import_to_xml to |
|
186 |
# handle import |
|
187 |
text_value = unicode(v) |
|
188 |
ET.SubElement(el, k).text = text_value |
|
181 | 189 |
elif type(val) is list: |
182 | 190 |
if attribute[-1] == 's': |
183 | 191 |
atname = attribute[:-1] |
184 |
- |