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



我当前正在升级Django 1.9站点以使用Django 1.10。我很想升级到Django 1.11,但是网站使用的一些软件包尚未支持。

无论哪种方式,当我进入localhost:8000

时,我都会遇到以下错误

fielderror at/

'内容'不能为文章模型表格指定,因为它是一个 不可编辑的字段

请求方法:获取请求URL:http://localhost:8000/django 版本:1.10.9异常类型:Fielderror异常值:

'内容'不能为文章模型表格指定,因为它是一个 不可编辑的字段

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

该站点正在运行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

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

相关内容

最新更新