Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
3711 Представления

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 Ответы Просмотры Активность
1
авг. 24
1736
1
нояб. 23
4246
Delete my account Решено
3
нояб. 24
10538
2
дек. 22
14868
1
нояб. 21
4981