def connect(self):
self.build_connection_string()
if self.m_connection_str == None:
self.lg("Not connecting to this database", 0)
return None
self.lg("Connecting to databases(" + str(self.m_connection_str) + ") Autocommit(" + str(self.m_autocommit) + ") Autoflush(" + str(self.m_autoflush) + ")", 7)
Base = declarative_base()
self.m_engine = create_engine(self.m_connection_str,
echo=False)
self.m_connection = self.m_engine.connect()
self.m_session = scoped_session(sessionmaker(autocommit = self.m_autocommit,
autoflush = self.m_autoflush,
bind = self.m_engine))
self.lg("Connected to DB(" + str(self.m_name) + ") DBTables(" + str(self.m_database_name) + ")", 7)
return None
# end of connect
评论列表
文章目录