svn: r6377
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
2006-04-19 Don Allingham <don@gramps-project.org>
|
2006-04-19 Don Allingham <don@gramps-project.org>
|
||||||
|
* src/GrampsDb/_DbUtils.py: fix handle vs. ref issues
|
||||||
* src/RelLib/_Family.py: add remove_child_handle
|
* src/RelLib/_Family.py: add remove_child_handle
|
||||||
* src/DataViews/_EventView.py: more GrampsTypes changes
|
* src/DataViews/_EventView.py: more GrampsTypes changes
|
||||||
* src/DataViews/_PedigreeView.py: more GrampsTypes changes
|
* src/DataViews/_PedigreeView.py: more GrampsTypes changes
|
||||||
|
@@ -69,12 +69,12 @@ def remove_parent_from_family(db, person_handle, family_handle, trans=None):
|
|||||||
elif family.get_mother_handle() == person_handle:
|
elif family.get_mother_handle() == person_handle:
|
||||||
family.set_mother_handle(None)
|
family.set_mother_handle(None)
|
||||||
|
|
||||||
child_list = family.get_child_handle_list()
|
child_list = family.get_child_ref_list()
|
||||||
if (not family.get_father_handle() and not family.get_mother_handle() and
|
if (not family.get_father_handle() and not family.get_mother_handle() and
|
||||||
len(child_list) <= 1):
|
len(child_list) <= 1):
|
||||||
db.remove_family(family_handle, trans)
|
db.remove_family(family_handle, trans)
|
||||||
if child_list:
|
if child_list:
|
||||||
child = db.get_person_from_handle(child_list[0])
|
child = db.get_person_from_handle(child_list[0].ref)
|
||||||
child.remove_parent_family_handle(family_handle)
|
child.remove_parent_family_handle(family_handle)
|
||||||
db.commit_person(child, trans)
|
db.commit_person(child, trans)
|
||||||
msg = _("Remove father from family")
|
msg = _("Remove father from family")
|
||||||
@@ -102,12 +102,12 @@ def remove_child_from_family(db, person_handle, family_handle, trans=None):
|
|||||||
else:
|
else:
|
||||||
need_commit = False
|
need_commit = False
|
||||||
|
|
||||||
child_list = family.get_child_handle_list()
|
child_list = family.get_child_ref_list()
|
||||||
if (not family.get_father_handle() and not family.get_mother_handle() and
|
if (not family.get_father_handle() and not family.get_mother_handle() and
|
||||||
len(child_list) <= 1):
|
len(child_list) <= 1):
|
||||||
db.remove_family(family_handle, trans)
|
db.remove_family(family_handle, trans)
|
||||||
if child_list:
|
if child_list:
|
||||||
child = db.get_person_from_handle(child_list[0])
|
child = db.get_person_from_handle(child_list[0].ref)
|
||||||
child.remove_parent_family_handle(family_handle)
|
child.remove_parent_family_handle(family_handle)
|
||||||
db.commit_person(child, trans)
|
db.commit_person(child, trans)
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user