witnesses in reports

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

witnesses in reports

Eugène Dubois
Hello all,

This is my first email to this group, so please be patient with me.
I have been working as a programmer in the Netherlands for 30 years, but never used Python.

My question is this:
Because witnesses to Christenings in the Netherlands are really important to find family relations, I am trying to adapt some reports, to show witnesses in the text with the Christening date / place...

What is the best way to retrieve witnesses to an event?

Thank you very much for your help.

Eugene Dubois


--
--
Genealogie in Limburg: http://genealogie-limburg.net
Genwiki: http://genwiki.nl
DubGar Webdesign: http://dubgar.com


_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: witnesses in reports

GRAMPS - Dev mailing list
Dear Eugene,

I am not an experienced Gramps developer so others might know much better answers, but for a project (web app) I recently modified the function gramps.gen.utils.db.get_participant_from_event to return a dictionary of all event particpants, given an event handle, which will return a dictionary of the form (e.g.):
{'Witness': [{'type': 'Person', 'gramps_id': 'I0123'}, {'type': 'Person', 'gramps_id': 'I0234'}], 'Family': [{'type': 'Family', 'gramps_id': 'F0345'}]}
where the key is the role. Maybe this is what you need? You can find the code here:



Cheers,
David

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Am Dienstag, 17. September 2019 21:14 schrieb Eugène Dubois <[hidden email]>:

Hello all,

This is my first email to this group, so please be patient with me.

I have been working as a programmer in the Netherlands for 30 years, but never used Python.

My question is this:
Because witnesses to Christenings in the Netherlands are really important to find family relations, I am trying to adapt some reports, to show witnesses in the text with the Christening date / place...

What is the best way to retrieve witnesses to an event?

Thank you very much for your help.

Eugene Dubois


--
--
Genealogie in Limburg: http://genealogie-limburg.net
DubGar Webdesign: http://dubgar.com



_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: witnesses in reports

Nick Hall
On 17/09/2019 20:59, David Straub via Gramps-devel wrote:
I am not an experienced Gramps developer so others might know much better answers, but for a project (web app) I recently modified the function gramps.gen.utils.db.get_participant_from_event to return a dictionary of all event particpants, given an event handle, which will return a dictionary of the form (e.g.):
{'Witness': [{'type': 'Person', 'gramps_id': 'I0123'}, {'type': 'Person', 'gramps_id': 'I0234'}], 'Family': [{'type': 'Family', 'gramps_id': 'F0345'}]}
where the key is the role. Maybe this is what you need? You can find the code here:


Yes.  This is the correct  approach.

First find the backlinks from the event.  For witnesses, you are only interested in people.  Then loop through the events looking for the event you are interested in with a role of "EventRoleType.WITNESS".

Nick.




_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel