我在 django 中编辑了一个模型,结果出现错误:以下模型的“table reserve_time 没有名为 reservation 的列”:
from django.db import models
import datetime
class Club(models.Model):
establishment = models.CharField(max_length=200)
address = models.CharField(max_length=200)
def __unicode__(self):
return self.establishment
class Day(models.Model):
club = models.ForeignKey(Club)
day = models.DateField('day')
def __unicode__(self):
return unicode(self.day)
class Court(models.Model):
club = models.ForeignKey(Club)
day = models.ForeignKey(Day)
court = models.IntegerField(max_length=200)
def __unicode__(self):
return unicode(self.court)
class Time(models.Model):
club = models.ForeignKey(Club)
day = models.ForeignKey(Day)
court = models.ForeignKey(Court)
time = models.TimeField('time')
reservation = models.CharField(max_length=200)
def __unicode__(self):
return unicode(self.time)
之后我运行了 python manage.py syncdb 和 python manage.py runserver ,但仍然出现上述错误。有想法该怎么解决这个吗?如果我删除“预订”字段,它工作正常。在管理员中,出现“预订”的文本框,但当我尝试保存时出现错误。