I want to mass delete in ORM django level but i want to see or simulate the impact of cascaded instance that connected to it. Thanks in advance
After you perform delete()
method of Model, you can print
returned value of delete()
method.
instance = Model.objects.get(pk=1)
val = instance.delete() # returns tuple object
print(val) # this will give you all information
Or before you delete something, You can count all related objects (Reverse ForeignKey
) save result in variable and then delete.
Hope, it helps you.