def get_db():
'''Opens a new database connection if there is none yet for the
current application context.'''
if not hasattr(g, 'sqlite_db'):
g.sqlite_db = connect_db()
debug('Database connection created.')
return g.sqlite_db
评论列表
文章目录