Try NoSQL
This commit is contained in:
1 parent
aab10fb599
commit
a254886bad
65 files changed
+7372
-761
No files matched your search
@@ -31,7 +31,7 @@ class Env(object):
|
||||
_app_dir = ""
|
||||
_data_dir = ""
|
||||
_cache_dir = ""
|
||||
_db_path = ""
|
||||
_db = ""
|
||||
_log_path = ""
|
||||
|
||||
@staticmethod
|
||||
@@ -54,28 +54,6 @@ class Env(object):
|
||||
def set(attr, value):
|
||||
return setattr(Env, '_' + attr, value)
|
||||
|
||||
@staticmethod
|
||||
def getSession():
|
||||
existing_session = Env.get('session')
|
||||
if existing_session:
|
||||
return existing_session()
|
||||
|
||||
session = scoped_session(sessionmaker(bind = Env.getEngine()))
|
||||
Env.set('session', session)
|
||||
|
||||
return session()
|
||||
|
||||
@staticmethod
|
||||
def getEngine():
|
||||
existing_engine = Env.get('engine')
|
||||
if existing_engine:
|
||||
return existing_engine
|
||||
|
||||
engine = create_engine(Env.get('db_path'), echo = False)
|
||||
Env.set('engine', engine)
|
||||
|
||||
return engine
|
||||
|
||||
@staticmethod
|
||||
def setting(attr, section = 'core', value = None, default = '', type = None):
|
||||
|
||||
|
||||
Reference in new issue
Block a user