From 68dbfcc1a1dc7a5a3880604167692211d583a1e2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com>
Date: Mon, 20 Feb 2023 12:43:17 +0100
Subject: [PATCH] MAINT: added code comment

---
 src/caosdb/common/models.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/caosdb/common/models.py b/src/caosdb/common/models.py
index ba9ba3de..08fcd020 100644
--- a/src/caosdb/common/models.py
+++ b/src/caosdb/common/models.py
@@ -719,6 +719,14 @@ out: List[Entity]
         """
 
         for parent in self.parents:
+            # TODO:
+            # Comment on _wrap and _wrapped_entity
+            # Currently, I (henrik) do not why the wrapping is necessary (and it is not
+            # documented). However, the following illustrates, why I think, it is a bad idea.
+            # First you add a parent with rec.add_parent(parent), but then you cannot access
+            # attributes of parent when you use rec.parents[0] for example becasue you do not get
+            # the same object but a wrapping object and you need to know that you only get the
+            # original by accessing the private (!) _wrapped_entity object.
             w_parent = parent._wrapped_entity
             if retrieve:
                 parent.retrieve()
-- 
GitLab