def _asDict(self): """ Gets the dict representation of the object """ # Use OFS exportXML to first export to xml f = StringIO() XMLExportImport.exportXML(self._p_jar, self._p_oid, f) # Get the value of exported XML xml_value = f.getvalue() return xmltodict.parse(xml_value)
def fromJSON(self, val): """ Updates an object, based on a JSON representation """ 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)
def export_object_to_xml(ob, fp): XMLExportImport.exportXML(ob._p_jar, ob._p_oid, fp)
def import_object_from_xml(where, fp): return XMLExportImport.importXML(where._p_jar, fp)
def import_object_from_xml(where, fp): return XMLExportImport.importXML(where._p_jar, fp)