introspection.py 文件源码

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

项目:liberator 作者: libscie 项目源码 文件源码
def installed_models(self, tables):
        "Returns a set of all models represented by the provided list of table names."
        from django.apps import apps
        from django.db import router
        all_models = []
        for app_config in apps.get_app_configs():
            all_models.extend(router.get_migratable_models(app_config, self.connection.alias))
        tables = list(map(self.table_name_converter, tables))
        return {
            m for m in all_models
            if self.table_name_converter(m._meta.db_table) in tables
        }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号