我正在尝试使用另一个对象的值作为如下选择。因此,我将有一个预定义的维护类型列表,可以在impact字段中进行选择。当我试图创建这个模型时,我得到了一个错误
[root@network-tools infternal]# python manage.py makemigrations maintenance
SystemCheckError: System check identified some issues:
ERRORS:
maintenance.Maintenance.Impact: (fields.E004) 'choices' must be an iterable (e.g., a list or tuple).
模型配置
^{pr2}$
“ForeignKey”是更好的解决方案。你也可以试试下面的代码。在
在模型.py在
在表单.py在
^{pr2}$相关问题 更多 >
编程相关推荐