Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
3767 Переглядів

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.

Аватар
Відмінити
Автор Найкраща відповідь

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
Delete Blank Lines Вирішено
1
серп. 24
1768
1
лист. 23
4271
Delete my account Вирішено
3
лист. 24
10583
2
груд. 22
14924
1
лист. 21
5046