Skip to content
Snippets Groups Projects
Commit dc4ea6f1 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

Merge branch 'dev' into f-generic-analysis

parents 12c4d33b 7f3ccfb2
Branches
Tags
2 merge requests!39Release 0.4.0,!20created draft for generic analysis method
Pipeline #17089 passed
......@@ -7,10 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ##
### Added ###
- `check_reference_field` function to check whether entities with provided ids
exits (for example when importing data from a table)
- added the `datatypes` argument to `TableImporter` for columns that do not
need a special conversion function
- `generic_analysis.py` allows to easily call scripts to perform analyses in
server side scripting
......@@ -24,6 +21,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Security ###
## [0.3.1] - 2021-12-06 ##
### Added ###
- `check_reference_field` function to check whether entities with provided ids
exits (for example when importing data from a table)
- added the `datatypes` argument to `TableImporter` for columns that do not
need a special conversion function
## [0.3.0] - 2021-11-02 ##
### Added ###
......
......@@ -47,7 +47,7 @@ from setuptools import find_packages, setup
MAJOR = 0
MINOR = 3
MICRO = 1
MICRO = 2
PRE = "" # e.g. rc0, alpha.1, 0.beta-23
ISRELEASED = False
......
......@@ -66,10 +66,25 @@ def separated(text):
return "-"*60 + "\n" + text
def apply_list_of_updates(to_be_updated, update_flags,
def apply_list_of_updates(to_be_updated, update_flags={},
update_cache=None, run_id=None):
"""
Updates the to_be_updated Container, i.e. pushes the changes to CaosDB
"""Updates the `to_be_updated` Container, i.e., pushes the changes to CaosDB
after removing possible duplicates. If a chace is provided, uauthorized
updates can be cached for further authorization.
Parameters:
-----------
to_be_updated : db.Container
Container with the entities that will be updated.
update_flags : dict, optional
Dictionary of CaosDB server flags that will be used for the
update. Default is an empty dict.
update_cache : UpdateCache or None, optional
Cache in which the intended updates will be stored so they can be
authorized afterwards. Default is None.
run_id : String or None, optional
Id with which the pending updates are cached. Only meaningful if
`update_cache` is provided. Default is None.
"""
if len(to_be_updated) == 0:
......@@ -90,9 +105,10 @@ def apply_list_of_updates(to_be_updated, update_flags,
baseurl = db.configuration.get_config()["Connection"]["url"]
for el in to_be_updated:
def make_clickable(txt, id):
return "<a href='{}/Entity/{}'>{}</a>".format(baseurl, id, txt)
for el in to_be_updated:
info += str("\t" + make_clickable(el.name, el.id)
if el.name is not None
else "\t" + make_clickable(str(el.id), el.id))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment