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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-pylib
Commits
c5b576e1
Commit
c5b576e1
authored
3 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Indentation and line widths
parent
eaefb51b
No related branches found
No related tags found
1 merge request
!13
F documentation data models
Pipeline
#10535
passed
3 years ago
Stage: code_style
Stage: linting
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/doc/tutorials/complex_data_models.rst
+57
-53
57 additions, 53 deletions
src/doc/tutorials/complex_data_models.rst
with
57 additions
and
53 deletions
src/doc/tutorials/complex_data_models.rst
+
57
−
53
View file @
c5b576e1
...
@@ -50,15 +50,19 @@ r2.add_property(p3, value=1) # this is an integer property with a value
...
@@ -50,15 +50,19 @@ r2.add_property(p3, value=1) # this is an integer property with a value
# Very complex part of the data model:
# Very complex part of the data model:
# Case 1: File added to another file
# Case 1: File added to another file
f2.add_property(p1, value=f1) # this adds a file property with value first file to the second file
f2.add_property(p1, value=f1) # this adds a file property with value first file
# to the second file
# Case 2: Property added to a property
# Case 2: Property added to a property
p2.add_property(p3, value=27) # this adds an integer property with value 27 to the double property
p2.add_property(p3, value=27) # this adds an integer property with value 27 to the
# double property
# Case 3: Reference property added to a property
# Case 3: Reference property added to a property
# The property p2 now has two sub properties, one is pointing to record p2 which itself
# The property p2 now has two sub properties, one is pointing to
# has the property p2, therefore this can be considered a loop in the data model.
# record p2 which itself has the property p2, therefore this can be
p2.add_property(p4, value=r2) # this adds a reference property pointing to record 2 to the double property
# considered a loop in the data model.
p2.add_property(p4, value=r2) # this adds a reference property pointing to
# record 2 to the double property
# Insert a container containing all the newly created entities:
# Insert a container containing all the newly created entities:
c = db.Container().extend([rt1, rt2, r1, r2, f1, p1, p2, p3, f2, p4])
c = db.Container().extend([rt1, rt2, r1, r2, f1, p1, p2, p3, f2, p4])
...
...
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