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
7af933d1
Commit
7af933d1
authored
3 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
DOC: document further ideas on how to design the Python client in future
parent
a9220368
No related branches found
No related tags found
1 merge request
!57
RELEASE 0.7.3
Pipeline
#22435
passed
3 years ago
Stage: code_style
Stage: linting
Stage: setup
Stage: test
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/doc/future_caosdb.md
+13
-0
13 additions, 0 deletions
src/doc/future_caosdb.md
with
13 additions
and
0 deletions
src/doc/future_caosdb.md
+
13
−
0
View file @
7af933d1
...
...
@@ -69,6 +69,11 @@ Analogue, to what Pandas does. Provide bracket notation
`rec.properties["test"]`
for Properties with names that are in conflict with
default attributes or contain spaces (or other forbidden characters).
Entities can be initialized with a set of Propertynames. Those Propertynames will be used as
attributes such that tab completion is possible in interactive use. The value however will be a special
value (e.g. UnsetPropertyValue) and accessing it results in an Exception. Thus, tab completion can be used
but no Properties are inserted unexpectedly with NULL values.
-
Raise Exception if attribute does not exist but is accessed?
[
Discussion
](
https://gitlab.com/caosdb/caosdb-pylib/-/issues/60
)
...
...
@@ -168,6 +173,14 @@ inserted = new_one.insert()
print
(
"
The new record has the ID:
"
,
inserted
.
id
)
```
### Factory method
While creating an Entity will not talk to a CaosDB server and can thus be done offline, the factory method
`create_record`
allows to
1.
Retrieve the parent and set attributes according to inheritance
2.
Use a container to resolve the parent and set attributes
In general, more complex "magic" will be placed in the factory and only the straight forward version
in the constructor.
### References and sub entities
...
...
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