Commit 0436c8e4 authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_config: Add function to get erp5 object from its JSON representation

parent 0f9d1983
...@@ -74,10 +74,16 @@ class JSONRepresentableMixin: ...@@ -74,10 +74,16 @@ class JSONRepresentableMixin:
xml_value = f.getvalue() xml_value = f.getvalue()
return xmltodict.parse(xml_value) return xmltodict.parse(xml_value)
def fromJSON(self): def fromJSON(self, val):
""" """
Updates an object, based on a JSON representation Updates an object, based on a JSON representation
""" """
pass dict_value = json.loads(val)
# Convert the dict_value to XML representation
xml_value = xmltodict.unparse(dict_value)
f = StringIO(xml_value)
return XMLExportImport.importXML(self._p_jar, f)
InitializeClass(JSONRepresentableMixin) InitializeClass(JSONRepresentableMixin)
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