Skip to content
Snippets Groups Projects
Commit 6a0fe0c9 authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

Merge branch 'f-changes-for-dicom' into 'dev'

ListConverter treats StructureElements

See merge request !70
parents 055ca88c 9a6a07ba
Branches
Tags caosdb-pylib-v0.7.2 caosdb-server-v0.7.2
2 merge requests!91Release 0.3,!70ListConverter treats StructureElements
Pipeline #30610 passed
...@@ -812,6 +812,8 @@ class ListElementConverter(Converter): ...@@ -812,6 +812,8 @@ class ListElementConverter(Converter):
children.append(TextElement(str(index), list_element)) children.append(TextElement(str(index), list_element))
elif isinstance(list_element, dict): elif isinstance(list_element, dict):
children.append(DictElement(str(index), list_element)) children.append(DictElement(str(index), list_element))
elif isinstance(list_element, StructureElement):
children.append(list_element)
else: else:
raise NotImplementedError( raise NotImplementedError(
f"Unkown type {type(list_element)} in list element {list_element}.") f"Unkown type {type(list_element)} in list element {list_element}.")
......
...@@ -463,7 +463,9 @@ class CaosDBIdentifiableAdapter(IdentifiableAdapter): ...@@ -463,7 +463,9 @@ class CaosDBIdentifiableAdapter(IdentifiableAdapter):
candidates = db.execute_query(query_string) candidates = db.execute_query(query_string)
if len(candidates) > 1: if len(candidates) > 1:
raise RuntimeError( raise RuntimeError(
f"Identifiable was not defined unambigiously.\n{query_string}\nReturned the following {candidates}.") f"Identifiable was not defined unambigiously.\n{query_string}\nReturned the "
f"following {candidates}."
f"Identifiable:\n{identifiable.record_type}{identifiable.properties}")
if len(candidates) == 0: if len(candidates) == 0:
return None return None
return candidates[0] return candidates[0]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment