From: Jérôme <rom...@ya...> - 2009-01-02 08:19:21
|
Stéphane, > I was looking through functions like get_handle_referents(), get_referenced_handles(), and get_referenced_handles_recursively()...what are the differences? I don't know ... But if you want to get a person related to an event (primary role or not), you may try Utils.get_referents(handle, db, primary_objects): def get_referents(handle, db, primary_objects): """ Find objects that refer to an object. This function is the base for other get_<object>_referents finctions. """ # Use one pass through the reference map to grab all the references object_list = [item for item in db.find_backlink_handles(handle)] # Then form the object-specific lists the_lists = () for primary in primary_objects: primary_list = [item[1] for item in object_list if item[0] == primary] the_lists = the_lists + (primary_list, ) return the_lists Note: seems there is a typo on description ! Jérôme Stéphane Charette a écrit : > I'm walking through code, confused and not seeing what I expect. > Hoping someone can set me straight. > > Say I have a birth event. How do I get the person to whom this event applies? > > I was looking through functions like get_handle_referents(), > get_referenced_handles(), and > get_referenced_handles_recursively()...what are the differences? I'm > not even certain I'm barking up the right tree -- have I missed > something? > > Thanks! > > Stéphane > > ------------------------------------------------------------------------------ > _______________________________________________ > Gramps-devel mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/gramps-devel > |