-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filtering with double underscores does not seem to work as expected #158
Comments
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) |
There was a specific case where using Django built-in lookups for relationships doesn't work properly with the soft delete solution we implemented with `django-safedelete`. According to the library maintainers, it's a known limitation[1]. To work around this limitation, a customized filter set were created for Group schema on GraphQL. This custom filter set implements the adjustments expected to ignore soft deleted objects when filtering by relationships (joins). [1] - makinacorpus/django-safedelete#158
There was a specific case where using Django built-in lookups for relationships doesn't work properly with the soft delete solution we implemented with `django-safedelete`. According to the library maintainers, it's a known limitation[1]. To work around this limitation, a customized filter set were created for Group schema on GraphQL. This custom filter set implements the adjustments expected to ignore soft deleted objects when filtering by relationships (joins). [1] - makinacorpus/django-safedelete#158
There was a specific case where using Django built-in lookups for relationships doesn't work properly with the soft delete solution we implemented with `django-safedelete`. According to the library maintainers, it's a known limitation[1]. To work around this limitation, a customized filter set were created for Group schema on GraphQL. This custom filter set implements the adjustments expected to ignore soft deleted objects when filtering by relationships (joins). [1] - makinacorpus/django-safedelete#158
@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. |
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?
The text was updated successfully, but these errors were encountered: