更新csv文件时遇到困难

时间:2017-07-07 14:12:44

标签: python django

我尝试使用说明列更新CSV文件。我尝试通过添加description = models.CharField(max_length=200, default='SOME STRING')来添加模型更新:

wine = models.ForeignKey(Wine)
    pub_date = models.DateTimeField('date published')
    user_name = models.CharField(max_length=100)
    comment = models.CharField(max_length=200)
    rating = models.IntegerField(choices=RATING_CHOICES)
    description = models.CharField(max_length=200, default='SOME STRING')

当我为此更改运行迁移时,出现以下错误:

c:\Users\Amira Joshi\Desktop\winerama>python manage.py makemigrations
Migrations for 'reviews':
  reviews\migrations\0002_review_description.py
    - Add field description to review

我该如何解决?请帮忙!

1 个答案:

答案 0 :(得分:1)

这不是错误:

c:\Users\Amira Joshi\Desktop\winerama>python manage.py makemigrations 
Migrations for 'reviews':   reviews\migrations\0002_review_description.py
    - Add field description to review

有了这个django说创建了迁移文件,现在你必须通过运行这个命令来应用迁移:

python manage.py migrate