def connectDB(self): if settings.DATABASE_DRIVER == "sqlite": log.debug('DB_Sqlite INIT') import DB_Sqlite return DB_Sqlite.DB_Sqlite() elif settings.DATABASE_DRIVER == "mysql": if settings.VARIABLE_DIFF: log.debug("DB_Mysql_Vardiff INIT") import DB_Mysql_Vardiff return DB_Mysql_Vardiff.DB_Mysql_Vardiff() else: log.debug('DB_Mysql INIT') import DB_Mysql return DB_Mysql.DB_Mysql() elif settings.DATABASE_DRIVER == "postgresql": log.debug('DB_Postgresql INIT') import DB_Postgresql return DB_Postgresql.DB_Postgresql() elif settings.DATABASE_DRIVER == "none": log.debug('DB_None INIT') import DB_None return DB_None.DB_None() else: log.error('Invalid DATABASE_DRIVER -- using NONE') log.debug('DB_None INIT') import DB_None return DB_None.DB_None()
def connectDB(self): self.database_extend = hasattr( settings, 'DATABASE_EXTEND') and getattr(settings, 'DATABASE_EXTEND') is True # Choose our database driver and put it in self.dbi if settings.DATABASE_DRIVER == "sqlite": log.debug('DB_Sqlite INIT') import DB_Sqlite return DB_Sqlite.DB_Sqlite() elif settings.DATABASE_DRIVER == "mysql": log.debug('DB_Mysql INIT') if self.database_extend: import DB_Mysql_Extended return DB_Mysql_Extended.DB_Mysql_Extended() else: import DB_Mysql return DB_Mysql.DB_Mysql() elif settings.DATABASE_DRIVER == "postgresql": log.debug('DB_Postgresql INIT') import DB_Postgresql return DB_Postgresql.DB_Postgresql() elif settings.DATABASE_DRIVER == "none": log.debug('DB_None INIT') import DB_None return DB_None.DB_None() else: log.error('Invalid DATABASE_DRIVER -- using NONE') log.debug('DB_None INIT') import DB_None return DB_None.DB_None()
def connectDB(self): if settings.DATABASE_DRIVER == "sqlite": import DB_Sqlite return DB_Sqlite.DB_Sqlite() elif settings.DATABASE_DRIVER == "mysql": import DB_Mysql_Extended return DB_Mysql_Extended.DB_Mysql_Extended() elif settings.DATABASE_DRIVER == "postgresql": import DB_Postgresql return DB_Postgresql.DB_Postgresql() elif settings.DATABASE_DRIVER == "none": import DB_None return DB_None.DB_None() else: log.error('Invalid DATABASE_DRIVER -- using NONE') import DB_None return DB_None.DB_None()
def connectDB(self): # Choose our database driver and put it in self.dbi if settings.DATABASE_DRIVER == "sqlite": log.debug('DB_Sqlite INIT') import DB_Sqlite return DB_Sqlite.DB_Sqlite() elif settings.DATABASE_DRIVER == "mysql": log.debug('DB_Mysql INIT') import DB_Mysql return DB_Mysql.DB_Mysql() elif settings.DATABASE_DRIVER == "postgresql": log.debug('DB_Postgresql INIT') import DB_Postgresql return DB_Postgresql.DB_Postgresql() elif settings.DATABASE_DRIVER == "none": log.debug('DB_None INIT') import DB_None return DB_None.DB_None() else: log.error('Invalid DATABASE_DRIVER -- using NONE') log.debug('DB_None INIT') import DB_None return DB_None.DB_None()