# Shared Events without a required role

**URL:** <https://gramps.discourse.group/t/shared-events-without-a-required-role/7176>\
**Category:** Help\
**Created:** [March 7, 2025, 4:55am UTC](https://gramps.discourse.group/t/shared-events-without-a-required-role/7176 "2025-03-07T04:55:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [March 7, 2025, 4:55am UTC](https://gramps.discourse.group/t/shared-events-without-a-required-role/7176/1 "2025-03-07T04:55:57Z")

</div>

A user on Reddit r/gramps [wants to validate for christenings](https://www.reddit.com/r/gramps/comments/1j46ik9/gramplet_to_track_missing_data/) and godparents for each christening.

I can see how to filter for Persons without a christening. But how could Gramps be made to find Christening Events that lack being “[shared](https://gramps-project.org/wiki/index.php/Gramps_Glossary#sharing)” with a Godparent **role**?

---

<div class="post-metadata">

**Author:** ![PLegoux](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/plegoux/32/413_2.png) [@PLegoux](https://gramps.discourse.group/u/PLegoux)\
**Post date:** [March 7, 2025, 9:36am UTC](https://gramps.discourse.group/t/shared-events-without-a-required-role/7176/3 "2025-03-07T09:36:11Z")

</div>

With a filter similar to this one - **Baptism: Godfather or Godmother not linked to the event** (_Baptême: Parrain ou Marraine non liés à l’événement_) - based on supertool (it uses my [ST\_filters\_init.py](https://www.dropbox.com/scl/fi/omxfv2jqcwmki4i1y46n0/ST_filters_init.py?rlkey=0js4ymt0tg2dqu4u5em1ecetq&dl=0) library):

 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/4/450462f06e83ff05d96ac08d77478d2db127894e.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/0/0eb01be1ca0a48dd67b4b18ce798d91c0e1e6b94.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/1/1ac413c3adfa20f453526ee9d6def047b366d463.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/4/4e5900d06a1005746c03f7f87bff4a0b41ea7471.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/c/cd9962b8205eadb74a74f834bb046eba0d0d5d66.png)

In French _Parrain_ means Godfather and _Marraine_ Godmother, _Baptême_ means Baptism.

* * *

Same filters from custom\_filters.xml file:

Persons section:

```xml
    <filter name="08. Check: Baptême; Parrain ou Marraine non liés à l'événement - 507p" function="and" comment="507p (I08.507p) - Filtre == [E87.547p] -">
      <rule class="MatchesEventFilter" use_regex="False" use_case="False">
        <arg value="87. Type['Baptême'] &amp; Type['Baptême', Participants.Role=('Parrain' | 'Marraine')].length(eq.0) - 547p"/>
      </rule>
      <rule class="HasEvent" use_regex="False" use_case="False">
        <arg value="Baptism"/>
        <arg value=""/>
        <arg value=""/>
        <arg value=""/>
        <arg value=""/>
        <arg value="1"/>
      </rule>
    </filter>

```

Events section:

```xml
    <filter name="87. Type['Baptême'] &amp; Type['Baptême', Participants.Role=('Parrain' | 'Marraine')].length(eq.0) - 547p" function="or" comment="547p (E87.547p) - Filter(|) == [E88.545p, E88.546p]">
      <rule class="MatchesFilter" use_regex="False" use_case="False">
        <arg value="88. Type['Baptême'] &amp; Type['Baptême', Participants.Role='Marraine'].length(eq.0) - 545p"/>
      </rule>
      <rule class="MatchesFilter" use_regex="False" use_case="False">
        <arg value="88. Type['Baptême'] &amp; Type['Baptême', Participants.Role='Parrain'].length(eq.0) - 546p"/>
      </rule>
    </filter>
    <filter name="88. Type['Baptême'] &amp; Type['Baptême', Participants.Role='Marraine'].length(eq.0) - 545p" function="and" comment="545p (E88.545p) - Filter(&amp;) == [E90.544i]">
      <rule class="HasEventBasePlus" use_regex="False" use_case="False">
        <arg value="Baptism"/>
        <arg value=""/>
        <arg value=""/>
        <arg value=""/>
        <arg value=""/>
      </rule>
      <rule class="MatchesFilter" use_regex="False" use_case="False">
        <arg value="90. Type['Baptême', Participants.Role='Marraine'] - 544i"/>
      </rule>
    </filter>
    <filter name="88. Type['Baptême'] &amp; Type['Baptême', Participants.Role='Parrain'].length(eq.0) - 546p" function="and" comment="546p (E88.546p) - Filter(&amp;) == [E90.543i]">
      <rule class="HasEventBasePlus" use_regex="False" use_case="False">
        <arg value="Baptism"/>
        <arg value=""/>
        <arg value=""/>
        <arg value=""/>
        <arg value=""/>
      </rule>
      <rule class="MatchesFilter" use_regex="False" use_case="False">
        <arg value="90. Type['Baptême', Participants.Role='Parrain'] - 543i"/>
      </rule>
    </filter>
    <filter name="90. Type['Baptême', Participants.Role='Marraine'] - 544i" function="and" invert="1" comment="544i (E90.544i)">
      <rule class="MatchesFilter" use_regex="False" use_case="False">
        <arg value="90. Type['Baptême', Participants.Role='Marraine'] - 544p"/>
      </rule>
    </filter>
    <filter name="90. Type['Baptême', Participants.Role='Marraine'] - 544p" function="and" comment="544p (E90.544p) - - Supertool">
      <rule class="GenericFilterRule_Event" use_regex="False" use_case="False">
        <arg value="gramps_id in rtypeRole.gid"/>
        <arg value="@include ST_filters_init.py&lt;br&gt;&lt;br&gt;rtypeRole = STF_participant_role(&lt;br&gt; # Valeurs modifiables - début&lt;br&gt; event_type = &quot;Baptism&quot;,&lt;br&gt; participant_role = &quot;Marraine&quot;&lt;br&gt; # Valeurs modifiables - fin&lt;br&gt;)"/>
        <arg value="rtypeRole.recherche(namespace=namespace, gramps_id=gramps_id, participants=participants, type=type, objet=obj)"/>
      </rule>
    </filter>
    <filter name="90. Type['Baptême', Participants.Role='Parrain'] - 543i" function="and" invert="1" comment="543i (E90.543i)">
      <rule class="MatchesFilter" use_regex="False" use_case="False">
        <arg value="90. Type['Baptême', Participants.Role='Parrain'] - 543p"/>
      </rule>
    </filter>
    <filter name="90. Type['Baptême', Participants.Role='Parrain'] - 543p" function="and" comment="543p (E90.543p) - - Supertool">
      <rule class="GenericFilterRule_Event" use_regex="False" use_case="False">
        <arg value="gramps_id in rtypeRole.gid"/>
        <arg value="@include ST_filters_init.py&lt;br&gt;&lt;br&gt;rtypeRole = STF_participant_role(&lt;br&gt; # Valeurs modifiables - début&lt;br&gt; event_type = &quot;Baptism&quot;,&lt;br&gt; participant_role = &quot;Parrain&quot;&lt;br&gt; # Valeurs modifiables - fin&lt;br&gt;)"/>
        <arg value="rtypeRole.recherche(namespace=namespace, gramps_id=gramps_id, participants=participants, type=type, objet=obj)"/>
      </rule>
    </filter>

```

You need to make some changes to both level 90 event filters to make the whole filter work in English, probably you just need to replace Parrain/Marraine with Godfather/Godmother in Supertool Initial statements (untested)

* * *

The Supertool filter _STF\_participant\_role_ from my library searches for events of the indicated type and whose references (Persons or Families) are of a particular role

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [March 7, 2025, 3:36pm UTC](https://gramps.discourse.group/t/shared-events-without-a-required-role/7176/4 "2025-03-07T15:36:27Z")

</div>

This is very informative. Thank you.

It could be made more efficient by reducing the Role permutations so that the parameter count is reduced.

Using the [Types Cleanup Tool](https://gramps-project.org/wiki/index.php/Addon:Types_Cleanup_Tool) addon to consolidate the roles (Godmother and Godfather to Godparent; goddaughter and godson to godchild) cuts the runtime.

---

<div class="post-metadata">

**Author:** ![PLegoux](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/plegoux/32/413_2.png) [@PLegoux](https://gramps.discourse.group/u/PLegoux)\
**Post date:** [March 7, 2025, 4:09pm UTC](https://gramps.discourse.group/t/shared-events-without-a-required-role/7176/5 "2025-03-07T16:09:53Z")

</div>

> [@emyoulation](#):
>
> Using the [Types Cleanup Tool](https://gramps-project.org/wiki/index.php/Addon:Types_Cleanup_Tool) addon to consolidate the roles (Godmother and Godfather to Godparent; goddaughter and godson to godchild) cuts the runtime.

Probably but there is no equivalent word to Godparent in French, so I need two searches in my case

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [April 6, 2025, 4:10pm UTC](https://gramps.discourse.group/t/shared-events-without-a-required-role/7176/6 "2025-04-06T16:10:01Z")

</div>

Closed on April 6, 2025, 4:10pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
