Skip to content
Snippets Groups Projects
Verified Commit f2310818 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Merge branch 'dev' into f-filesystem

parents 07b78cbf 2f216cef
Branches
Tags
2 merge requests!86Draft: ENH: file system: core,!58F filesystem
Pipeline #19492 passed with warnings
This commit is part of merge request !86. Comments created here will be created in the context of that merge request.
......@@ -20,9 +20,10 @@ guidelines of the CaosDB Project
3. Check all general prerequisites.
4. Prepare [setup.py](./setup.py): Check the `MAJOR`, `MINOR`, `MICRO`, `PRE`
variables and set `ISRELEASED` to `True`. Use the possibility to issue
pre-release versions for testing.
4. Update the version:
- `version` variables in `src/doc/conf.py`
- Version on [setup.py](./setup.py): Check the `MAJOR`, `MINOR`, `MICRO`, `PRE` variables and set
`ISRELEASED` to `True`. Use the possibility to issue pre-release versions for testing.
5. Merge the release branch into the main branch.
......
......@@ -381,7 +381,10 @@ def _single_convert_to_python_object(robj, entity):
return robj
def _single_convert_to_entity(entity, robj, **kwargs):
def _single_convert_to_entity(entity, robj, recursive_depth, **kwargs):
"""
recursive_depth: disabled if 0
"""
if robj._id is not None:
entity.id = robj._id
......@@ -407,16 +410,16 @@ def _single_convert_to_entity(entity, robj, **kwargs):
else:
entity.add_parent(id=parent)
def add_property(entity, prop, name, recursive=False, datatype=None):
def add_property(entity, prop, name, _recursive=False, datatype=None):
if datatype is None:
raise ArgumentError("datatype must not be None")
raise RuntimeError("Datatype must not be None.")
if isinstance(prop, CaosDBPythonEntity):
entity.add_property(name=name, value=str(
prop._id), datatype=datatype)
if recursive and not prop.do_not_expand:
return convert_to_entity(prop, recursive=recursive)
if _recursive and not prop.do_not_expand:
return convert_to_entity(prop, recursive=_recursive)
else:
return []
else:
......@@ -426,6 +429,11 @@ def _single_convert_to_entity(entity, robj, **kwargs):
return []
if recursive_depth == 0:
recursive = False
else:
recursive = True
for prop in robj._properties:
value = robj.__getattribute__(prop)
......@@ -439,7 +447,7 @@ def _single_convert_to_entity(entity, robj, **kwargs):
if recursive and not v.do_not_expand:
children.append(convert_to_entity(
v, recursive=recursive))
v, recursive=recursive_depth-1))
else:
if isinstance(v, float) or isinstance(v, int):
lst.append(str(v))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment