From 1a102afbd12c00ce4d755c81dfcc6c8dfbae7cca Mon Sep 17 00:00:00 2001 From: Richard Taylor Date: Tue, 20 Dec 2005 14:31:01 +0000 Subject: [PATCH] removed get_backlink_handles from RelLib svn: r5592 --- ChangeLog | 4 ++++ src/RelLib/_helper.py | 18 ------------------ test/RelLib_Test.py | 41 +---------------------------------------- 3 files changed, 5 insertions(+), 58 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4308f429c..a4285c2ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-12-20 Richard Taylor + * src/RelLib/_helper.py: removed get_backlink_handles + * test/RelLib_Test.py: removed test for get_backlink_handles + 2005-12-19 Don Allingham * src/ReadXML.py: handle _NAME_TRANS keyerror exception diff --git a/src/RelLib/_helper.py b/src/RelLib/_helper.py index d1e0d2249..d6126f75d 100644 --- a/src/RelLib/_helper.py +++ b/src/RelLib/_helper.py @@ -375,24 +375,6 @@ class PrimaryObject(BaseObject,PrivacyBase): def _replace_handle_reference(self,classname,old_handle,new_handle): pass - - def get_backlink_handles(self,db,include_classes=None): - """Get a list of all primary objects that make some reference to this - primary object, either directly or via a child object. - - Returns an iterator over tuples each of the form (class_name,handle). - - To get a list use: - - references = [ ref for ref in obj.get_backlink_handles() ] - - @param db: a object with the find_backlink_handles method - @type db: usually a instance of a class derived from GrampsDbBase. - @param include_classes: the primary classes to include in the result. - @type: tuple of primary class names as strings, or None for all classes. - """ - - return db.find_backlink_handles(self.get_handle(),include_classes) def set_marker(self,marker): self.marker = marker diff --git a/test/RelLib_Test.py b/test/RelLib_Test.py index 4ea5bad31..f2d8670cb 100644 --- a/test/RelLib_Test.py +++ b/test/RelLib_Test.py @@ -24,47 +24,8 @@ from GrampsDbTestBase import GrampsDbBaseTest class PrimaryObjectTest (GrampsDbBaseTest): """Test methods on the PrimaryObject class""" - def test_get_backlink_handles(self): - """Check that backlink lookup works.""" - - source = self._add_source() - person = self._add_person_with_sources([source]) - - references = [ ref for ref in source.get_backlink_handles(self._db) ] - - assert len(references) == 1 - assert references[0] == (RelLib.Person.__name__,person.get_handle()) - - def test_get_backlink_handles_with_class_list(self): - """Check backlink lookup with class list.""" - - source = self._add_source() - person = self._add_person_with_sources([source]) - - self._add_family_with_sources([source]) - self._add_event_with_sources([source]) - self._add_place_with_sources([source]) - self._add_media_object_with_sources([source]) - - references = [ ref for ref in source.get_backlink_handles(self._db) ] - - # make sure that we have the correct number of references (one for each object) - references = [ ref for ref in source.get_backlink_handles(self._db) ] - - assert len(references) == 5, "len(references) == %s " % str(len(references)) - - # should just return the person reference - references = [ ref for ref in source.get_backlink_handles(self._db,(RelLib.Person.__name__,)) ] - assert len(references) == 1, "len(references) == %s " % str(len(references)) - assert references[0][0] == RelLib.Person.__name__, "references = %s" % repr(references) - - # should just return the person and event reference - references = [ ref for ref in source.get_backlink_handles(self._db,(RelLib.Person.__name__, - RelLib.Event.__name__)) ] - assert len(references) == 2, "len(references) == %s " % str(len(references)) - assert references[0][0] == RelLib.Person.__name__, "references = %s" % repr(references) - assert references[1][0] == RelLib.Event.__name__, "references = %s" % repr(references) + pass def testSuite():