From f5038ef2452c51bbc35038f99ffa3220be6d3fd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com>
Date: Mon, 21 Nov 2022 14:40:27 +0100
Subject: [PATCH] DOC: add comments

---
 src/caoscrawler/identifiable_adapters.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/caoscrawler/identifiable_adapters.py b/src/caoscrawler/identifiable_adapters.py
index e694178e..52596016 100644
--- a/src/caoscrawler/identifiable_adapters.py
+++ b/src/caoscrawler/identifiable_adapters.py
@@ -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():
-- 
GitLab