* src/GrampsDb/_GrampsBSDDB.py: Upgrade path to new RelLib.

* src/RelLib/_Family.py: Require non-empty child_ref.


svn: r6332
This commit is contained in:
Alex Roitman
2006-04-13 18:25:52 +00:00
parent eeb1573d40
commit 6e6f9fbfba
3 changed files with 89 additions and 131 deletions

View File

@@ -375,9 +375,8 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
@param person_handle: L{Person} database handle
@type person_handle: str
"""
if child_ref and not isinstance(child_ref,ChildRef):
if not isinstance(child_ref,ChildRef):
raise ValueError("expecting ChildRef instance")
assert(child_ref.ref)
self.child_ref_list.append(child_ref)
def remove_child_ref(self,child_ref):
@@ -391,7 +390,7 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
in the list.
@rtype: bool
"""
if child_ref and not isinstance(childref,ChildRef):
if not isinstance(childref,ChildRef):
raise ValueError("expecting ChildRef instance")
new_list = [ref for ref in self.child_ref_list
if ref.ref != child_ref.ref ]