From a69337b6c677fd22da77db278f534a41f2b19790 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 23 May 2010 15:44:51 +0000 Subject: [PATCH] method for getting base database, if a proxy svn: r15465 --- src/gen/db/read.py | 5 +++++ src/gen/proxy/proxybase.py | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/src/gen/db/read.py b/src/gen/db/read.py index 7dd254c71..7bd37083a 100644 --- a/src/gen/db/read.py +++ b/src/gen/db/read.py @@ -1466,3 +1466,8 @@ class DbBsddbRead(DbReadBase, Callback): """ return self._bm_changes > 0 + def get_base_db(self): + """ + Return the base database. + """ + return self diff --git a/src/gen/proxy/proxybase.py b/src/gen/proxy/proxybase.py index 30e8d68bb..c53f75671 100644 --- a/src/gen/proxy/proxybase.py +++ b/src/gen/proxy/proxybase.py @@ -722,3 +722,12 @@ class ProxyDbBase(DbReadBase): def get_note_bookmarks(self): """returns the list of Note handles in the bookmarks""" return self.note_bookmarks + + def get_base_db(self): + """ + Return the base database. + """ + basedb = self + while isinstance(basedb, ProxyDbBase): + basedb = basedb.db + return basedb