Django 1 to Django 2 on_delete error

后端 未结 2 1117
予麋鹿
予麋鹿 2021-01-24 12:46

I believe this workflow was created for a previous Django version. Now when I am trying to upgrade it I get an error to add on_delete. Here is what I have done but it is still n

2条回答
  •  感情败类
    2021-01-24 13:29

    According to the Django 2.0 docs (and also the release notes) all Foreignkey fields now have a required on_delete parameter.

    It seems to be missing on your model's fields. The release notes also advise to take a look at your migrations:

    The on_delete argument for ForeignKey and OneToOneField is now required in models and migrations. Consider squashing migrations so that you have fewer of them to update.

提交回复
热议问题