当我点击管理网站上的User_datas
时,该网站告诉我(1054, "Unknown column 'click_data_id' in 'field list'")
这是我的models.py:
class Click_Data(models.Model):
word = models.CharField(max_length=255)
click_times = models.IntegerField(default=0)
class Meta:
ordering = ('word',)
def __unicode__(self):
return self.word
class User_Data(models.Model):
user = models.CharField(max_length=20)
click_data = models.ForeignKey(Click_Data)
class Meta:
ordering = ('user',)
def __unicode__(self):
return self.user
当我运行./manage.py migrate -l
时,终端会显示以下信息,这是迁移目录中文件的名称。
admin
[X] 0001_initial
auth
[X] 0001_initial
[X] 0002_alter_permission_name_max_length
[X] 0003_alter_user_email_max_length
[X] 0004_alter_user_username_opts
[X] 0005_alter_user_last_login_null
[X] 0006_require_contenttypes_0002
contenttypes
[X] 0001_initial
[X] 0002_remove_content_type_name
registration
[X] 0001_initial
sessions
[X] 0001_initial
yigu
[X] 0001_initial
[X] 0002_gw
[X] 0003_click_data_user_data
有人能给我一些提示吗?