These are chat archives for django/django

2nd
Mar 2016
vaibhav jain
@vaibhav-jain
Mar 02 2016 03:58
Thanks
vaibhav jain
@vaibhav-jain
Mar 02 2016 13:37
Can someone please tell me how to do this
Filip Figiel
@megapctr
Mar 02 2016 14:45
@vaibhav-jain I think you have to add a receiver for pre_delete signal for your parent class
and manually delete related items
which will then emit signals
ah wait
you want reverse behavior - run some code only when parent is deleted
Hmm I don't know what's going on here actually
what do you mean by "parent class"?
does Item and Transaction inherit from Packet?
vaibhav jain
@vaibhav-jain
Mar 02 2016 16:00
Yes they do
Can I set some attribute to Packet instance in the DeleteView which can be used later in the pre_delete signals??
vaibhav jain
@vaibhav-jain
Mar 02 2016 16:50
@megapctr Here detailed pastebin https://dpaste.de/LoqQ
Filip Figiel
@megapctr
Mar 02 2016 21:14
Your pre_delete handlers could check if they received the correct instance before doing anything
I thin that's the cleanest solution