I have the Model where i have relations with 3 diff models.
Now i know that if i use
object.delete()
, then child objects will also gets deleted.
Now the problem is that in my whole models classes i have the database column called DELETED
which i want to set to 1 whenever someone deletes some object.
I can override the deleted function in class called BaseModel
and and override the custom delete method of updating field to 1. But the problem is
If i do that way then i have to manually go through all the cascading relationships and manually call the delete ob every object.
Is there any way that by just calling object.delete(). It automatically traverses through child objects as well