Skip to content
Snippets Groups Projects
Commit f5038ef2 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

DOC: add comments

parent 10f70268
Branches
Tags
2 merge requests!91Release 0.3,!67MAINT: introduce an identifiable class
......@@ -197,6 +197,8 @@ class IdentifiableAdapter(metaclass=ABCMeta):
"Multi properties used in identifiables could cause unpredictable results and are"
" not allowed. You might want to consider a Property with a list as value.")
# use the RecordType of the registred Identifiable if it exists
# We do not use parents of Record because it might have multiple
return Identifiable(record_type=(registered_identifiable.parents[0].name
if registered_identifiable else None),
name=record.name,
......@@ -414,6 +416,7 @@ class CaosDBIdentifiableAdapter(IdentifiableAdapter):
"""
if len(record.parents) == 0:
return None
# TODO We need to treat the case where multiple parents exist properly.
rt_name = record.parents[0].name
for name, definition in self._registered_identifiables.items():
if definition.parents[0].name.lower() == rt_name.lower():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment