Skip to content
Snippets Groups Projects
Commit 7af933d1 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

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!57RELEASE 0.7.3
Pipeline #22435 passed
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment