Skip to Content
Menu
This question has been flagged
1 Reply
3056 Views

Hello,
When I'm deleting model instance I want to check some conditions and if that conditions are true then allow deleting and if conditions are false don't allow user to delete entry.
So what  I thought, __del__() method is destructor and first I was thinking to use this function but after some testings it doesn't work as I want, so I must find another way. I want to find a way to test conditions before deletion happens and decide allow or not.
If question is still unclear tell me.

Avatar
Discard
Author Best Answer

I've found a solution: I must override unlink method

Avatar
Discard
Related Posts Replies Views Activity
1
Aug 24
363
0
Jul 24
193
1
Nov 23
2606
3
Nov 24
8270
2
Dec 22
12876