Python Django ImageField core=在newforms admin中为False
在转换到newforms admin的过程中,我很难弄清楚如何为ImageFields指定core=False 我得到以下错误:Python Django ImageField core=在newforms admin中为False,python,django,django-models,Python,Django,Django Models,在转换到newforms admin的过程中,我很难弄清楚如何为ImageFields指定core=False 我得到以下错误: TypeError: __init__() got an unexpected keyword argument 'core' [Edit]但是,只要删除核心参数,我就会在尝试提交时在管理界面中出现“This field is required.”错误。如何使用newforms admin完成core=False的任务?这很简单。我在几年前就开始遇到这个问题。基本上
TypeError: __init__() got an unexpected keyword argument 'core'
[Edit]但是,只要删除核心参数,我就会在尝试提交时在管理界面中出现“This field is required.”错误。如何使用newforms admin完成core=False的任务?这很简单。我在几年前就开始遇到这个问题。基本上,只需删除模型中ImageField中的“core=True”参数,然后按照说明转换为newforms admin使用的内容。不再使用
core
属性
发件人:
您可以安全地删除任何和所有core
参数。它们不再被使用。newforms admin现在为内联中的现有实例提供了一个很好的删除复选框
要去掉“This field is required”,您需要使用blank=True(如果不是CharField,也可能是null=True),使其成为非必需字段。我想它已经被删除了,但我很好奇替代方法是如何工作的。该链接中的任何内容都不能立即取代core=False。