【发布时间】:2021-01-20 09:39:01
【问题描述】:
我正在尝试进行迁移,但我不能。
代码:
from .setting import WORK_TYPE,USER_ACCOUNT
class Rating (models.Model):
RATING_CHOICES = (
('poor','Poor'),
('average', 'Average'),
('good', 'Good'),
('verygood', 'Very Good'),
('excellent', 'Excellent')
),
rating = models.CharField(max_length=30,choices=RATING_CHOICES, default='poor')
create_at=models.DateTimeField(auto_now_add=True)
update_at=models.DateTimeField(auto_now=True)
这给出了错误:'choices' must be an iterable containing (actual value, human readable name)
【问题讨论】:
标签: python django-models