diff --git a/src/caosdb/apiutils.py b/src/caosdb/apiutils.py index 28e9a410f18a846493afda01ed27554d3878ac13..37a130b2dd9d43cb3d716d7ad9078af15f5c2434 100644 --- a/src/caosdb/apiutils.py +++ b/src/caosdb/apiutils.py @@ -195,7 +195,8 @@ def getCommitIn(folder): return t.readline().strip() -def compare_entities(old_entity: Entity, new_entity: Entity, compare_referenced_records: bool = False): +def compare_entities(old_entity: Entity, new_entity: Entity, + compare_referenced_records: bool = False): """Compare two entites. Return a tuple of dictionaries, the first index belongs to additional information for old @@ -207,7 +208,7 @@ def compare_entities(old_entity: Entity, new_entity: Entity, compare_referenced_ - Each property lists either an additional property or a property with a changed: - datatype - importance or - - value (not implemented yet) + - value In case of changed information the value listed under the respective key shows the value that is stored in the respective entity. @@ -217,6 +218,9 @@ def compare_entities(old_entity: Entity, new_entity: Entity, compare_referenced_ `compare_referenced_records = False` to prevent infinite recursion in case of circular references). + NOTE: This function does not work for abstract properties! I.e. it is not possible + to directly compare two entities that are of class db.Property. + Parameters ---------- old_entity, new_entity : Entity