From 5f928d53790e517b97fe3ffd31bd6ad3ff5f33c5 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sat, 3 Dec 2016 19:13:44 +0000 Subject: [PATCH] Add missing base methods --- gramps/gen/db/base.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gramps/gen/db/base.py b/gramps/gen/db/base.py index 393cb8f3e..092b7831f 100644 --- a/gramps/gen/db/base.py +++ b/gramps/gen/db/base.py @@ -341,6 +341,17 @@ class DbReadBase: """ raise NotImplementedError + def get_place_tree_cursor(self): + """ + Return a reference to a cursor that iterates over Place objects in the + order they appear in the place hierarchy. Example use:: + + with get_place_tree_cursor() as cursor: + for handle, place in cursor: + # process place object pointed to by the handle + """ + raise NotImplementedError + def get_repository_cursor(self): """ Return a reference to a cursor over Repository objects. Example use:: @@ -1106,6 +1117,12 @@ class DbReadBase: """ raise NotImplementedError + def has_citation_handle(self, handle): + """ + Return True if the handle exists in the current Citation database. + """ + raise NotImplementedError + def has_tag_handle(self, handle): """ Return True if the handle exists in the current Tag database. @@ -1735,6 +1752,18 @@ class DbWriteBase(DbReadBase): """ raise NotImplementedError + def undo(self, update_history=True): + """ + Undo last transaction. + """ + raise NotImplementedError + + def redo(self, update_history=True): + """ + Redo last transaction. + """ + raise NotImplementedError + def write_version(self, name): """ Write version number for a newly created DB.