utils.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:mistral-actions 作者: int32bit 项目源码 文件源码
def db_transaction(function):
    @six.wraps(function)
    def inner(*args, **kwargs):
        config = alembic_cfg.Config(
            os.path.join(os.path.dirname(__file__), 'alembic.ini'))
        config.set_main_option(
            'script_location',
            'mistral.db.sqlalchemy.migration:alembic_migrations')
        # attach the Mistral conf to the Alembic conf
        config.mistral_config = CONF

        CONF(project='mistral')
        with db_api.transaction():
            return function(*args, **kwargs)

    return inner
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号