From c3e6486db1cbf734df85cf13cd1b89d6c2f4b4fd Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 2 Jun 2006 04:40:13 +0000 Subject: [PATCH] 2006-06-01 Don Allingham * src/Filters/Rules/Person/_HaveAltFamilies.py: bring up to speed with RelLib changes svn: r6847 --- ChangeLog | 4 ++++ src/Filters/Rules/Person/_HaveAltFamilies.py | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b392c10d1..bbdb67c62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-06-01 Don Allingham + * src/Filters/Rules/Person/_HaveAltFamilies.py: bring up to speed with + RelLib changes + 2006-06-01 Brian Matherly * src/plugins/CmdRef.py: upgrade to new report interface * src/ReportBase/_DrawFormatComboBox.py: missing imports diff --git a/src/Filters/Rules/Person/_HaveAltFamilies.py b/src/Filters/Rules/Person/_HaveAltFamilies.py index 2a6732f08..f9c37e189 100644 --- a/src/Filters/Rules/Person/_HaveAltFamilies.py +++ b/src/Filters/Rules/Person/_HaveAltFamilies.py @@ -46,8 +46,11 @@ class HaveAltFamilies(Rule): category = _('Family filters') def apply(self,db,person): - for (fam,rel1,rel2) in person.get_parent_family_handle_list(): - if rel1 == ChildRefType.CHILD_ADOPTED \ - or rel2 == ChildRefType.CHILD_ADOPTED: + for fhandle in person.get_parent_family_handle_list(): + family = db.get_family_from_handle(fhandle) + ref = [ ref for ref in family.get_child_ref_list() \ + if ref.ref == person.handle] + if ref[0].get_father_relation() == ChildRefType.ADOPTED \ + or ref[0].get_mother_relation() == ChildRefType.ADOPTED: return True return False