Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-pylib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-pylib
Commits
604b9fc7
Commit
604b9fc7
authored
2 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
DOC: document _wrap a bit
parent
89b28858
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!95
DOC: Added CITATION.cff to the list of files in the release guide where the...
,
!94
Get parents recursively
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caosdb/common/models.py
+8
-0
8 additions, 0 deletions
src/caosdb/common/models.py
with
8 additions
and
0 deletions
src/caosdb/common/models.py
+
8
−
0
View file @
604b9fc7
...
@@ -102,6 +102,8 @@ class Entity:
...
@@ -102,6 +102,8 @@ class Entity:
self
.
_checksum
=
None
self
.
_checksum
=
None
self
.
_size
=
None
self
.
_size
=
None
self
.
_upload
=
None
self
.
_upload
=
None
# If an entity is used (e.g. as parent), it is wrapped instead of being used directly.
# see Entity._wrap()
self
.
_wrapped_entity
=
None
self
.
_wrapped_entity
=
None
self
.
_version
=
None
self
.
_version
=
None
self
.
_cuid
=
None
self
.
_cuid
=
None
...
@@ -1331,6 +1333,12 @@ out: List[Entity]
...
@@ -1331,6 +1333,12 @@ out: List[Entity]
flags
=
flags
)[
0
]
flags
=
flags
)[
0
]
def
_wrap
(
self
,
entity
):
def
_wrap
(
self
,
entity
):
"""
When entity shall be used as parent or property it is not added to the corresponding list
(such as the parent list) directly, but another Entity object is created and the original
Entity is wrapped using this function
TODO: document here and in dev docs why this is done.
"""
self
.
_wrapped_entity
=
entity
self
.
_wrapped_entity
=
entity
return
self
return
self
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment