'str' object is not callable when i try to use DeleteView in Django

前端 未结 1 1475
情深已故
情深已故 2021-01-27 13:11

here are my files

urls.py the URL paths I created for the delete process

path(\'dress//delete\', views.DressDelete.as_vie         


        
1条回答
  •  天涯浪人
    2021-01-27 13:39

    on_delete argument should has specific value, not simple strings. You need to change your foreign keys to the following:

    dress_town = models.ForeignKey(Town, on_delete=models.DO_NOTHING, verbose_name='المحافظة', blank=False)
    

    You need to use models.DO_NOTHING instead of DO_NOTHING string.

    0 讨论(0)
提交回复
热议问题