Open lmbak opened 3 years ago
Indeed this is not handled. You would need to explicitly exclude the deleted instances:
parents = Parent.objects.filter(children__name='May', children__deleted__isnull=False)
@Gagaro do you have thoughts on how this can be implemented? Would this require adding support would involve overriding the filter /other sql function implementations. Happy to contribute if there is a preferred path forward.
I'm not sure how the lookups are done for relations. I'm pretty sure this should not be done in the queryset or query, but at the field / descriptor level, this may require a new ForeignKey / etc type?
There may be something to be done with the base manager, but I think this may cause more issues down the line.
Working with Django's
.filter(foo__bar)
method does not seem to filter out the soft deleted models. Is that desired behaviour?Say we have these two models:
And we do:
Is this expected behaviour?