python类allow_migrate()的实例源码

__init__.py 文件源码 项目:LatinSounds_AppEnviaMail 作者: G3ek-aR 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def _check_backend_specific_checks(self, **kwargs):
        app_label = self.model._meta.app_label
        for db in connections:
            if router.allow_migrate(db, app_label, model_name=self.model._meta.model_name):
                return connections[db].validation.check_field(self, **kwargs)
        return []
special.py 文件源码 项目:django-wechat-api 作者: crazy-canux 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def database_forwards(self, app_label, schema_editor, from_state, to_state):
        if router.allow_migrate(schema_editor.connection.alias, app_label, **self.hints):
            self._run_sql(schema_editor, self.sql)
special.py 文件源码 项目:django-wechat-api 作者: crazy-canux 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def database_backwards(self, app_label, schema_editor, from_state, to_state):
        if self.reverse_sql is None:
            raise NotImplementedError("You cannot reverse this operation")
        if router.allow_migrate(schema_editor.connection.alias, app_label, **self.hints):
            self._run_sql(schema_editor, self.reverse_sql)
special.py 文件源码 项目:django-wechat-api 作者: crazy-canux 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def database_forwards(self, app_label, schema_editor, from_state, to_state):
        if router.allow_migrate(schema_editor.connection.alias, app_label, **self.hints):
            # We now execute the Python code in a context that contains a 'models'
            # object, representing the versioned models as an app registry.
            # We could try to override the global cache, but then people will still
            # use direct imports, so we go with a documentation approach instead.
            self.code(from_state.apps, schema_editor)
special.py 文件源码 项目:django-wechat-api 作者: crazy-canux 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def database_backwards(self, app_label, schema_editor, from_state, to_state):
        if self.reverse_code is None:
            raise NotImplementedError("You cannot reverse this operation")
        if router.allow_migrate(schema_editor.connection.alias, app_label, **self.hints):
            self.reverse_code(from_state.apps, schema_editor)


问题


面经


文章

微信
公众号

扫码关注公众号