Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3755 Vizualizări

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.

Imagine profil
Abandonează
Autor Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
aug. 24
1749
1
nov. 23
4257
3
nov. 24
10556
2
dec. 22
14903
1
nov. 21
5034