__init__.py 文件源码

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

项目:gardenbot 作者: GoestaO 项目源码 文件源码
def _execute_for_all_tables(self, app, bind, operation, skip_tables=False):
        app = self.get_app(app)

        if bind == '__all__':
            binds = [None] + list(app.config.get('SQLALCHEMY_BINDS') or ())
        elif isinstance(bind, string_types) or bind is None:
            binds = [bind]
        else:
            binds = bind

        for bind in binds:
            extra = {}
            if not skip_tables:
                tables = self.get_tables_for_bind(bind)
                extra['tables'] = tables
            op = getattr(self.Model.metadata, operation)
            op(bind=self.get_engine(app, bind), **extra)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号