diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 4308f429c..a4285c2ed 100644 --- a/gramps2/ChangeLog +++ b/gramps2/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/gramps2/src/RelLib/_helper.py b/gramps2/src/RelLib/_helper.py index d1e0d2249..d6126f75d 100644 --- a/gramps2/src/RelLib/_helper.py +++ b/gramps2/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/gramps2/test/RelLib_Test.py b/gramps2/test/RelLib_Test.py index 4ea5bad31..f2d8670cb 100644 --- a/gramps2/test/RelLib_Test.py +++ b/gramps2/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():