How do I override delete() on a model and have it still work with related deletes

后端 未结 8 1418
一向
一向 2020-12-13 09:24

I\'m having a problem because I\'m deleting a Widget by using some_widget_instance.delete(). I also have a model called WidgetFile with an override delete() method so that I

8条回答
  •  被撕碎了的回忆
    2020-12-13 09:58

    Is some_widget_instance and instance of Widget or of WidgetFile ? Because if it is an instance of Widget it won't get your custom delete() function, which is in the WidgetFile class.

提交回复
热议问题