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

ENH: Add special properties treatment for samples

parent 1a9e1857
No related branches found
No related tags found
1 merge request!1F awi sams
......@@ -44,6 +44,15 @@ def add_special_properties(sample: db.Record, data: pd.Series) -> db.Record:
return_value_if_not_none(data[get_column_header_name("Storage ID")]) is not None):
container = get_container(return_value_if_not_none(
data[get_column_header_name("Storage ID")]))
sample = update_property(sample, container_rt.id, contianer)
sample = update_property(sample, container_rt.id, container)
for name in ["Curator", "Collector"]:
prop = db.get_entity_by_name(name)
if (get_column_header_name(name) in data and
return_value_if_not_none(data[get_column_header_name(name)]) is not None):
persons = [get_person(id_str) for id_str in return_value_if_not_none(
data[get_column_header_name(name)])]
sample = update_property(sample, prop.id, persons,
datatype=db.LIST(get_entity_name("Person")))
return sample
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment