diff --git a/src/caosadvancedtools/cfood.py b/src/caosadvancedtools/cfood.py index 3058e58f0557e0f55030e3d5b214bb7345749415..bd5cb5108f59f86c3e0758d3f14e1b18bf812797 100644 --- a/src/caosadvancedtools/cfood.py +++ b/src/caosadvancedtools/cfood.py @@ -299,7 +299,7 @@ def assure_has_parent(entity, parent, to_be_updated=None, verbosity=INFO): def assure_has_property(entity, name, value, to_be_updated=None, - verbosity=INFO): + verbosity=INFO, datatype=None): """ Checks whether `entity` has a property `name` with the value `value`. @@ -332,7 +332,11 @@ def assure_has_property(entity, name, value, to_be_updated=None, name, value, entity.id)) print("/"*60) - entity.add_property(name=name, value=value) + + if datatype is None: + entity.add_property(name=name, value=value) + else: + entity.add_property(name=name, value=value, datatype=datatype) if to_be_updated is None: get_ids_for_entities_with_names([entity])