* src/RelLib/_Family.py: add remove_child_handle
svn: r6376
This commit is contained in:
parent
a71ac389b2
commit
2f5aa02120
@ -1,4 +1,5 @@
|
|||||||
2006-04-19 Don Allingham <don@gramps-project.org>
|
2006-04-19 Don Allingham <don@gramps-project.org>
|
||||||
|
* 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
|
||||||
* src/RelLib/_ChildRef.py: more GrampsTypes changes
|
* src/RelLib/_ChildRef.py: more GrampsTypes changes
|
||||||
|
@ -238,9 +238,11 @@ class ChildEmbedList(EmbeddedList):
|
|||||||
skip=[ x for x in skip if x])
|
skip=[ x for x in skip if x])
|
||||||
|
|
||||||
def del_button_clicked(self,obj):
|
def del_button_clicked(self,obj):
|
||||||
ref = self.get_selected()
|
handle = self.get_selected()
|
||||||
if ref:
|
if handle:
|
||||||
self.family.remove_child_ref(ref)
|
for ref in self.family.get_child_ref_list():
|
||||||
|
if ref.ref == handle:
|
||||||
|
self.family.remove_child_ref(ref)
|
||||||
self.rebuild()
|
self.rebuild()
|
||||||
|
|
||||||
def edit_button_clicked(self,obj):
|
def edit_button_clicked(self,obj):
|
||||||
|
@ -382,6 +382,21 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
|
|||||||
if ref.ref != child_ref.ref ]
|
if ref.ref != child_ref.ref ]
|
||||||
self.child_ref_list = new_list
|
self.child_ref_list = new_list
|
||||||
|
|
||||||
|
def remove_child_handle(self,child_handle):
|
||||||
|
"""
|
||||||
|
Removes the database handle for L{Person} to the Family's list
|
||||||
|
of children if the L{Person} is already in the list.
|
||||||
|
|
||||||
|
@param person_handle: L{Person} database handle
|
||||||
|
@type person_handle: str
|
||||||
|
@return: True if the handle was removed, False if it was not
|
||||||
|
in the list.
|
||||||
|
@rtype: bool
|
||||||
|
"""
|
||||||
|
new_list = [ref for ref in self.child_ref_list
|
||||||
|
if ref.ref != child_handle ]
|
||||||
|
self.child_ref_list = new_list
|
||||||
|
|
||||||
def get_child_ref_list(self):
|
def get_child_ref_list(self):
|
||||||
"""
|
"""
|
||||||
Returns the list of L{Person} handles identifying the children
|
Returns the list of L{Person} handles identifying the children
|
||||||
|
Loading…
Reference in New Issue
Block a user