Skip to content
Snippets Groups Projects

compare entities and parent/property lists

Merged Henrik tom Wörden requested to merge f-review-lists-and-compare into dev
1 unresolved thread

Files

+ 4
5
@@ -207,7 +207,8 @@ def compare_entities(entity0: Optional[Entity] = None,
If any of these characteristics differ for a property, the respective
string (datatype, importance, value) is added as a key to the dict of the
property with its value being the characteristics value,
e.g. {"prop": {"value": 6, 'importance': 'SUGGESTED'}}.
e.g. {"prop": {"value": 6, 'importance': 'SUGGESTED'}}. Except: None as
value is not added to the dict.
If a property is of type LIST, the comparison is order-sensitive.
Comparison of multi-properties is not yet supported, so should either
@@ -315,10 +316,8 @@ def compare_entities(entity0: Optional[Entity] = None,
# add to diff if attr has different values or is not set for one entity
if (attr0_unset != attr1_unset) or (attr0 != attr1):
if not attr0_unset:
diff[0][attr] = attr0
if not attr1_unset:
diff[1][attr] = attr1
diff[0][attr] = attr0
diff[1][attr] = attr1
# compare value
ent0_val, ent1_val = entity0.value, entity1.value
Loading