def objectHookHandler(json_dict):
for key, value in json_dict.items():
if isinstance(value, dict):
json_dict[key] = objectHookHandler(value)
else:
try:
json_dict[key] = datetime.strptime(value,
"%Y-%m-%dT%H:%M:%S.%f")
except Exception as ex:
pass
if "synergy_object" in json_dict:
synergy_object = json_dict["synergy_object"]
try:
objClass = import_class(synergy_object["name"])
objInstance = objClass()
return objInstance.deserialize(json_dict)
except SynergyError as ex:
raise ex
else:
return json_dict
评论列表
文章目录