From 835cf49a4288554e5b01cbdba38aefdc6165b457 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 7 Mar 2006 21:51:08 +0000 Subject: [PATCH] connect family members correctly svn: r6095 --- gramps2/src/Editors/_EditFamily.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/gramps2/src/Editors/_EditFamily.py b/gramps2/src/Editors/_EditFamily.py index 578dbf14f..18a09718a 100644 --- a/gramps2/src/Editors/_EditFamily.py +++ b/gramps2/src/Editors/_EditFamily.py @@ -544,8 +544,28 @@ class EditFamily(EditPrimary): if not original: trans = self.db.transaction_begin() + handle = self.obj.get_father_handle() + if handle: + parent = self.db.get_person_from_handle(handle) + parent.add_family_handle(self.obj.handle) + self.db.commit_person(parent,trans) + + handle = self.obj.get_mother_handle() + if handle: + parent = self.db.get_person_from_handle(handle) + parent.add_family_handle(self.obj.handle) + self.db.commit_person(parent,trans) + + for handle in self.obj.get_child_handle_list(): + child = self.db.get_person_from_handle(handle) + # fix + child.add_parent_family_handle(handle, + RelLib.Person.CHILD_BIRTH, + Rellib,Person.CHILD_BIRTH) + self.db.commit_person(child,trans) + self.db.add_family(self.obj,trans) - self.db.transaction_commit(trans,_("Edit Family")) + self.db.transaction_commit(trans,_("Add Family")) elif cmp(original.serialize(),self.obj.serialize()): trans = self.db.transaction_begin()