【发布时间】:2017-09-19 16:46:06
【问题描述】:
我目前正在升级 Django 1.9 站点以使用 Django 1.10。我很想升级到 Django 1.11,但是网站使用的一些包还不支持它。
无论哪种方式,当我转到 localhost:8000 时都会收到以下错误
FieldError 在/
不能为文章模型表单指定“内容”,因为它是 不可编辑的字段
请求方法:GET 请求地址:http://localhost:8000/Django 版本:1.10.9 异常类型:FieldError 异常值:
不能为文章模型表单指定“内容”,因为它是 不可编辑的字段
异常位置: /xxx-env/lib/python3.6/site-packages/django/forms/models.py 在 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
我想要一些关于如何解决此问题的提示或说明。
【问题讨论】:
标签: python django django-cms divio