(Please include your Gramps version and Operating System)
Gramps v5.1.5
OS: Linux
Desktop: Cinnamon 5.4.12 tk: GTK 3.24.24 wm: Mutter dm: LightDM Distro: LMDE 5 Elsie base: Debian 11.2 bullseye
Citations of people matching the
we currently have
Active Person
Descendants of
I need the next step to give the Citations of those people.
I think you are right, I need the events of the people first. Plus the events of the Families where those people are in the Primary Role.
Then the citations of all those events. Parents and children would be included in the original People list if required.
I’m trying to get to the list of Citations as given in the Detailed Descendant Report.
If you are looking at this from a coding point of view, the export module might be the best example of what data to gather.
For the Selected set of people, it exports EVERYTHING related to those people, including secondary objects and the Family containers where they were a member. (Although it correctly omits the spouses, parents, siblings and offspring if those people were not part of the filter.)
You just need the subset of Citations and Sources within the tree cutting that the Export grabs. (I had not considered the Place and Enclosing Place citations in my previous posting. Or the Repositories. But this would include those too.)
I’ve wrote a SuperTool script which find events with a specific role in persons or families records (STF_participant_role). But I’m not sure it cover all types @emyoulation enumerates.
@kku if it’s easy to call a Citation filter from SuperTool running in Citations, do you think it is possible from SuperTool running in Citations to call an Event filter to obtain citations from events it finds? Some kind of filter proxy.
If it’s possible it could be easy to call my first filter from a Citations SuperTool filter to find Citations used in events with a specific role in persons or families records.
The export builds a comprehensive set of objects & recursive secondary objects for a filter of persons.
Maybe there could be a generalized filter that gathers that leverages the code already done for export and delivers just the active category’s objects from that subset?
@PLegoux, I hope I understood correctly. This was not possible until now - but now SuperTool is updated to support accessing custom filters from another namespace. The syntax is like
f1 = filter(“event-filtername”, namespace=“Event”)
Hi @kku
I have been able to get a filter in another namespace to work, but I cannot get it to work when that filter calls another filter. Is it me or is this a problem.?
You could post the SuperTool script here along with the custom_filters.xml file from your Gramps User Directory. (Use the ‘code’ markup control. (An example capture and filter below. @kku these are NOT examples of his issue. They are examples of what kind of data would be provided.)
Or if you’ve installed his experimental FilterParams addon, you could post a visualization of how one filter calls the other(s):
[Gramps SuperTool script file]
version=1
[title]
SuperTool-CitationsforActivePersonDesc
[category]
Citations
[initial_statements]
# takes Event filter eventsofactivedescent as its input and outputs a list of Citations used in those Events
# George Baynes
events_list = filter("eventsofactivedescent", namespace = "Event")
[statements]
[filter]
[expressions]
citation
[scope]
filtered
[unwind_lists]
False
[commit_changes]
False
[summary_only]
False
and my custom_filters.xml is here - only the relevant bits (I hope)
I’m still trying to get it to work in display mode but I just get the full set of Citations. The Events filter works in Gramps. And I’ve tried using a simple Events filter with Supertool and that works fine.
Thanks for your time.
I’ve always run the filter in the Filter Gramplet of the Category view. Then applied the SuperTool script on the “Filtered Objects”. But since you’re using this to mock up finding the Citation List for to add to a Report, you won’t have that SuperTool shell simplifying things.
Script V2 (I’ve made some changes to make it working with every filters where citations exist):
[Gramps SuperTool script file]
version=1
[title]
SuperTool-Citations - Citations matching citations in another namespace filter results
[category]
Citations
[initial_statements]
filter_ns = "Person" # Valid values: Person, Event, ...
filter_name = "Descendants d'André Legoux" # Any filter name defined in previous namespace
ns_proxy = filter_ns + "Proxy"
ns_with_citations = ["Person", "Event", "Place", "Media", "Family"]
authorized = True if filter_ns in ns_with_citations else False
if authorized:
try:
sel_objects = filter(filter_name, namespace=filter_ns)
except:
authorized = False
[statements]
found = False
if authorized and filter_ns != namespace:
for c in citators:
if type(c).__name__ == ns_proxy:
if sel_objects(c):
found = True
break
[filter]
found
[expressions]
source.title, page
[scope]
all
[unwind_lists]
False
[commit_changes]
False
[summary_only]
False
PS: @kku Could you make namespace property available in Initial statements? If so it could be possible to test it there (In my case I could set my authorized variable to false there without need to test it every time in Statements)