本文整理汇总了Python中ccvpn.models.DBSession.remove方法的典型用法代码示例。如果您正苦于以下问题:Python DBSession.remove方法的具体用法?Python DBSession.remove怎么用?Python DBSession.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ccvpn.models.DBSession
的用法示例。
在下文中一共展示了DBSession.remove方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_database
# 需要导入模块: from ccvpn.models import DBSession [as 别名]
# 或者: from ccvpn.models.DBSession import remove [as 别名]
def setup_database():
""" Create an empty database and structure """
DBSession.remove()
engine = create_engine('sqlite://')
Base.metadata.create_all(engine)
DBSession.configure(bind=engine)
return DBSession
示例2: setUp
# 需要导入模块: from ccvpn.models import DBSession [as 别名]
# 或者: from ccvpn.models.DBSession import remove [as 别名]
def setUp(self):
if not 'mako.directories' in self.settings:
self.settings['mako.directories'] = 'ccvpn:templates/'
if not 'mako.imports' in self.settings:
self.settings['mako.imports'] = 'from ccvpn.filters import check'
self.config = testing.setUp(settings=self.settings)
self.config.include('pyramid_mailer.testing')
self.config.include('pyramid_mako')
self.config.include('pyramid_beaker')
self.config.include('pyramid_mailer.testing')
setup_routes(self.config)
DBSession.remove()
#self.engine = engine_from_config(settings, 'sqlalchemy.')
self.conn = self.engine.connect()
self.trans = self.conn.begin()
DBSession.configure(bind=self.conn)
Base.metadata.create_all(self.engine)
self.session = DBSession
示例3: tearDown
# 需要导入模块: from ccvpn.models import DBSession [as 别名]
# 或者: from ccvpn.models.DBSession import remove [as 别名]
def tearDown(self):
testing.tearDown()
DBSession.remove()