我正在尝试schemamigration
在我的模型上使用南(我正在使用django 1.4 and python 2.6 on ubuntu
)
最初我的模型是
class Review(models.Model):
reviewdate=models.DateField(default=date.today)
description=models.TextField()
author=models.ForeignKey(User,null=True)
我添加了一个字段
from django.core.validators import MinValueValidator,MaxValueValidator
class Review(models.Model):
reviewdate=models.DateField(default=date.today)
description=models.TextField()
author=models.ForeignKey(User,null=True)
rating = models.IntegerField(MinValueValidator(1),MaxValueValidator(10),default=5,help_text='integers 1 to 10')
当我跑步时
python manage.py schemamigration myapp --auto
我明白了TypeError
...
File "/home/me/Django-1.4/django/db/models/base.py", line 198, in __new__
new_class._prepare()
File "/home/me/Django-1.4/django/db/models/base.py", line 255, in _prepare
cls.__doc__ = "%s(%s)" % (cls.__name__, ", ".join([f.attname for f in opts.fields]))
TypeError: Error when calling the metaclass bases
sequence item 6: expected string, MaxValueValidator found
有人可以告诉我我错在哪里吗?