Skip to content
Snippets Groups Projects
Commit d4327eb1 authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

ENH: it is now possible to deserialize records using the high level api...

ENH: it is now possible to deserialize records using the high level api without giving parents or metadata
parent 5d81222a
No related branches found
No related tags found
1 merge request!107ENH: add entity getters and cached functions
Pipeline #37347 passed
......@@ -629,18 +629,20 @@ class CaosDBPythonEntity(object):
else:
entity = CaosDBPythonRecord()
for parent in serialization["parents"]:
if "unresolved" in parent:
id = None
name = None
if "id" in parent:
id = parent["id"]
if "name" in parent:
name = parent["name"]
entity.add_parent(CaosDBPythonUnresolvedParent(
id=id, name=name))
else:
raise NotImplementedError()
if "parents" in serialization:
for parent in serialization["parents"]:
if "unresolved" in parent:
id = None
name = None
if "id" in parent:
id = parent["id"]
if "name" in parent:
name = parent["name"]
entity.add_parent(CaosDBPythonUnresolvedParent(
id=id, name=name))
else:
raise NotImplementedError(
"Currently, only unresolved parents can be deserialized.")
for baseprop in ("name", "id", "description", "version"):
if baseprop in serialization:
......@@ -673,7 +675,8 @@ class CaosDBPythonEntity(object):
if f.name in metadata:
propmeta.__setattr__(f.name, metadata[f.name])
else:
raise NotImplementedError()
pass
# raise NotImplementedError()
return entity
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment