witten
/
luminotes
Archived
1
0
Fork 0

Now using BACKEND flags from Persistent.

This commit is contained in:
Dan Helfman 2008-08-19 17:49:02 -07:00
parent 410f6f8cbf
commit 1ecf88cd8f
1 changed files with 2 additions and 5 deletions

View File

@ -20,9 +20,6 @@ class Database( object ):
ID_BITS = 128 # number of bits within an id
ID_DIGITS = "0123456789abcdefghijklmnopqrstuvwxyz"
POSTGRESQL_BACKEND = 0
SQLITE_BACKEND = 1
# caching Notebooks causes problems because different users have different read_write/owner values
CLASSES_NOT_TO_CACHE = ( Notebook, )
@ -71,7 +68,7 @@ class Database( object ):
self.__connection = connection or \
Connection_wrapper( sqlite.connect( "luminotes.db", detect_types = sqlite.PARSE_DECLTYPES, check_same_thread = False ) )
self.__pool = None
self.__backend = Database.SQLITE_BACKEND
self.__backend = Persistent.SQLITE_BACKEND
else:
import psycopg2 as psycopg
from psycopg2.pool import PersistentConnectionPool
@ -100,7 +97,7 @@ class Database( object ):
),
)
self.__backend = Database.POSTGRESQL_BACKEND
self.__backend = Persistent.POSTGRESQL_BACKEND
self.__cache = cache