繁体   English   中英

无法为文章模型表单指定“内容”,因为它是不可编辑的字段

[英]'content' cannot be specified for Article model form as it is a non-editable field

我目前正在升级Django 1.9网站以使用Django 1.10。 我想升级到Django 1.11,但该网站使用的某些软件包尚不支持它。

无论哪种方式,当我进入localhost:8000时都会出现以下错误

/的FieldError

无法为文章模型表单指定“内容”,因为它是不可编辑的字段

请求方法:GET请求URL: http:// localhost:8000 / Django版本:1.10.9异常类型:FieldError异常值:

无法为文章模型表单指定“内容”,因为它是不可编辑的字段

例外位置:fields_for_model,第143行中的/xxx-env/lib/python3.6/site-packages/django/forms/models.py

该站点正在运行Django CMS 3.4.4以及其他Aldryn插件,所有这些插件都使用pip install

有问题的代码是这样的:

    if (fields is not None and f.name in fields and
            (exclude is None or f.name not in exclude)):
        raise FieldError(
            "'%s' cannot be specified for %s model form as it is a non-editable field" % (
                f.name, model.__name__)
        )
    continue

我希望找到一些技巧或指导来解决此问题。

我可以通过以下方式安装aldryn-newsblog的最新主版本来克服该错误: pip install git+https://github.com/aldryn/aldryn-newsblog.git@master

您也可以从这里这里观看讨论。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM