Refinements on database hierarchy

svn: r13907
This commit is contained in:
Doug Blank 2009-12-24 14:38:39 +00:00
parent ab2f9b9d19
commit 06d0291ff4
4 changed files with 9 additions and 12 deletions

View File

@ -46,8 +46,6 @@ class DbReadBase(object):
derived from this class should be created.
"""
super(DbReadBase, self).__init__()
def all_handles(self, table):
"""
Return all handles from the specified table as a list
@ -1172,7 +1170,7 @@ class DbReadBase(object):
"""
raise NotImplementedError
class DbWriteBase(DbReadBase):
class DbWriteBase(object):
"""
GRAMPS database object. This object is a base class for all
database interfaces. All methods raise NotImplementedError
@ -1187,8 +1185,6 @@ class DbWriteBase(DbReadBase):
derived from this class should be created.
"""
super(DbWriteBase, self).__init__()
def add_event(self, event, transaction, set_gid=True):
"""
Add an Event to the database, assigning internal IDs if they have

View File

@ -180,7 +180,7 @@ class DbBsddbRead(DbReadBase, Callback):
"""
DbReadBase.__init__(self)
#Callback.__init__(self)
Callback.__init__(self)
self.set_person_id_prefix('I%04d')
self.set_object_id_prefix('O%04d')

View File

@ -167,8 +167,7 @@ class DbBsddbAssocCursor(GrampsCursor):
# DbBsddb
#
#-------------------------------------------------------------------------
class DbBsddb(DbBsddbRead, DbWriteBase,
Callback, UpdateCallback):
class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"""
GRAMPS database write access object.
"""
@ -200,7 +199,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase,
self.txn = None
DbBsddbRead.__init__(self)
Callback.__init__(self)
DbWriteBase.__init__(self)
#UpdateCallback.__init__(self)
self.secondary_connected = False
self.has_changed = False

View File

@ -28,7 +28,7 @@
#------------------------------------------------------------------------
import web
import gen
from gen.db import DbBase
from gen.db import DbReadBase, DbWriteBase
from web.libdjango import DjangoInterface
# from ReportBase._CommandLineReport import run_report
@ -50,13 +50,14 @@ class Cursor(object):
def __exit__(self, *args, **kwargs):
pass
class DjangoDb(DbBase):
class DjangoDb(DbReadBase, DbWriteBase):
"""
A Gramps Database Backend. This replicates the grampsdb functions.
"""
def __init__(self):
super(DjangoDb, self).__init__()
DbReadBase.__init__(self)
DbWriteBase.__init__(self)
self.dji = DjangoInterface()
self.readonly = False
self.db_is_open = True