我刚刚在模型中添加了一个新字段,但是在运行ul {
margin:0;
padding:0;
}
li {
list-style: none;
overflow: hidden;
}
.item-list-container {
column-count: 4;
column-gap: 1.1em;
overflow: hidden;
margin-top: 107px;
}
.container {
overflow: hidden;
}
时它不会检测到任何东西,并且在访问管理界面时也不会显示新字段。我正在使用postgresql作为数据库。
python manage.py makemigrations
({class Movies(models.Model):
title = models.CharField(max_length=30, blank=True, null=True)
###(...)###
director_name = models.CharField(max_length=30, blank=True, null=True)
keywords = models.ManyToManyField('Keywords', through='MoviesKeywords', related_name='movies')# This is the new field
class Meta:
managed = True
db_table = 'movies'
是新字段)
我已经尝试过将应用程序的名称传递给命令,如下所示:
keywords
但是我也没有得到任何回应。
编辑:我设置了python manage.py makemigrations recommendations
并且可以迁移,但是该字段仍然没有显示