Skip to content
Snippets Groups Projects
Commit 5cec112c authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

ENH: also considere Referenzes of children of given RTs

parent 03cb9c91
No related branches found
No related tags found
2 merge requests!160STY: styling,!131Accept references of children
...@@ -212,11 +212,17 @@ identifiabel, identifiable and identified record) for a Record. ...@@ -212,11 +212,17 @@ identifiabel, identifiable and identified record) for a Record.
# TODO: similar to the Identifiable class, Registred Identifiable should be a # TODO: similar to the Identifiable class, Registred Identifiable should be a
# separate class too # separate class too
if prop.name.lower() == "is_referenced_by": if prop.name.lower() == "is_referenced_by":
for rtname in prop.value: for givenrt in prop.value:
if (id(record) in referencing_entities rt_and_children = [p.name
and rtname in referencing_entities[id(record)]): for p in db.execute_query(f"FIND RECORDTYPE {givenrt}")]
identifiable_backrefs.extend(referencing_entities[id(record)][rtname]) found = False
else: for rtname in rt_and_children:
if (id(record) in referencing_entities
and rtname in referencing_entities[id(record)]):
identifiable_backrefs.extend(
referencing_entities[id(record)][rtname])
found = True
if not found:
# TODO: is this the appropriate error? # TODO: is this the appropriate error?
raise NotImplementedError( raise NotImplementedError(
f"The following record is missing an identifying property:" f"The following record is missing an identifying property:"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment