Closed patlx closed 2 years ago
Yes, "citators" is a weak spot in SuperToool :-) In the next version there will be a generic function "referrers" that would help in this - then the call citation.referrers('Place')
would return a list of Place objects referring to the citation.
Now you can use this workaround: define a helper function "place_citators" as shown below and use it instead:
[initial_statements]
from supertool_engine import PlaceProxy
def place_citators(handle):
for _, rhandle in db.find_backlink_handles(
handle, include_classes=["Place"]
):
yield PlaceProxy(db, rhandle)
[statements]
for citation in citations:
print(citation.page, ":\n",
'---->', [referent for referent in place_citators(citation.handle) if "Place" in str(referent)])
Hope this helps.
Hi,
I've citations associated to places but the following little code doesn't work. It works well for Person and Event (I've not tried with Family) but It don't work for citations attached to places (this is what I'm looking for !):
Patrice