__init__.py 文件源码

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

项目:Scrum 作者: prakharchoudhary 项目源码 文件源码
def get_contenttypes_and_models(app_config, using, ContentType):
    if not router.allow_migrate_model(using, ContentType):
        return None, None

    ContentType.objects.clear_cache()

    content_types = {
        ct.model: ct
        for ct in ContentType.objects.using(using).filter(app_label=app_config.label)
    }
    app_models = {
        model._meta.model_name: model
        for model in app_config.get_models()
    }
    return content_types, app_models
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号