我运行了“python manage.py reset appname”然后“python manage.py syncdb”,因为我收到了错误:
“DatabaseError:表x没有名为y的列”。
虽然我在新视图(created_on)中添加的新列之一有效,但我仍然遇到“评级”列的问题。有什么建议吗?
class Review(models.Model):
review = models.CharField('Review', max_length = 2000)
date = models.DateField('date')
created_on = models.DateTimeField(auto_now_add = True)
updated_at = models.DateTimeField(auto_now = True)
user = models.CharField('Username', max_length = 200)
rating = models.IntegerField()
product = models.ForeignKey(Product)
def __unicode__(self):
return self.review