From 46257a4e5cfc3862e1c9d64cb55c59e46ce6c68f Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Fri, 14 Oct 2016 21:14:43 +0100 Subject: [PATCH] 9742: Rewrite get_*_from_gramps_id methods Use _get_raw_*_from_id_data methods rather than table maps. --- gramps/gen/db/generic.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/gramps/gen/db/generic.py b/gramps/gen/db/generic.py index 888545e20..de0a4458c 100644 --- a/gramps/gen/db/generic.py +++ b/gramps/gen/db/generic.py @@ -1341,31 +1341,40 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback): return self.iter_items(order_by, Family) def get_person_from_gramps_id(self, gramps_id): - return Person.create(self.person_id_map[gramps_id]) + data = self._get_raw_person_from_id_data(gramps_id) + return Person.create(data) def get_family_from_gramps_id(self, gramps_id): - return Family.create(self.family_id_map[gramps_id]) + data = self._get_raw_family_from_id_data(gramps_id) + return Family.create(data) def get_citation_from_gramps_id(self, gramps_id): - return Citation.create(self.citation_id_map[gramps_id]) + data = self._get_raw_citation_from_id_data(gramps_id) + return Citation.create(data) def get_source_from_gramps_id(self, gramps_id): - return Source.create(self.source_id_map[gramps_id]) + data = self._get_raw_source_from_id_data(gramps_id) + return Source.create(data) def get_event_from_gramps_id(self, gramps_id): - return Event.create(self.event_id_map[gramps_id]) + data = self._get_raw_event_from_id_data(gramps_id) + return Event.create(data) def get_media_from_gramps_id(self, gramps_id): - return Media.create(self.media_id_map[gramps_id]) + data = self._get_raw_media_from_id_data(gramps_id) + return Media.create(data) def get_place_from_gramps_id(self, gramps_id): - return Place.create(self.place_id_map[gramps_id]) + data = self._get_raw_place_from_id_data(gramps_id) + return Place.create(data) def get_repository_from_gramps_id(self, gramps_id): - return Repository.create(self.repository_id_map[gramps_id]) + data = self._get_raw_repository_from_id_data(gramps_id) + return Repository.create(data) def get_note_from_gramps_id(self, gramps_id): - return Note.create(self.note_id_map[gramps_id]) + data = self._get_raw_note_from_id_data(gramps_id) + return Note.create(data) def get_place_cursor(self): return Cursor(self.place_map)