Skip to content
Snippets Groups Projects
Commit 816fba33 authored by Henrik tom Wörden's avatar Henrik tom Wörden Committed by Henrik tom Wörden
Browse files

FIX: identify properties via name

parent 18a36848
No related branches found
No related tags found
No related merge requests found
......@@ -78,9 +78,13 @@ class AbstractCFood(object):
# move to api?
def set_property(entity, prop, value):
# TODO only do something when it is necessary?
if isinstance(prop, db.Entity):
name = prop.name
else:
name = prop
while entity.get_property(prop) is not None:
entity.remove_property(prop)
while entity.get_property(name) is not None:
entity.remove_property(name)
entity.add_property(prop, value)
@staticmethod
......
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