-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
Description
The problem seems to be in many to many scenarios.
Below a snippet on how to reproduce (untested)
# models
from softdelete.models import SoftDeleteModel
class ModelA(SoftDeleteModel):
name = models.CharField(max_length=16)
class ModelB(SoftDeleteModel):
name = models.CharField(max_length=16)
class M2M(SoftDeleteModel):
left = model.ForeignKey(ModelA, related_name='right')
right = model.ForeignKey(ModelB, related_name='left')# test
mA = ModelA.objects.create(name='A')
mB = ModelB.objects.create(name='B')
M2M.objects.create(left=mA, right=mB)
mB.objects.filter(left__left__name='A').count()
# Thats ok. Only one instance found here
M2M.objects.all().delete()
mB.objects.filter(left__left__name='A').count()
# Still finding objects when should be hiding through softdeleteReactions are currently unavailable