utils.py 文件源码

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

项目:django-horizon 作者: uncovertruth 项目源码 文件源码
def get_metadata_model():
    try:
        if (1, 11) > django.VERSION:
            return apps.get_model(get_config()['METADATA_MODEL'])
        else:
            return apps.get_model(get_config()['METADATA_MODEL'], require_ready=False)

    except ValueError:
        raise ImproperlyConfigured("METADATA_MODEL must be of the form 'app_label.model_name'")
    except LookupError:
        raise ImproperlyConfigured(
            "METADATA_MODEL refers to model '%s' that has not been installed"
            % get_config()['METADATA_MODEL']
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号