#35677: Unexpected behaviour of Prefetch with queryset filtering on a through model -------------------------------------+------------------------------------- Reporter: David Glenck | Owner: (none) Type: Uncategorized | Status: closed Component: Database layer | Version: 5.1 (models, ORM) | Severity: Normal | Resolution: needsinfo Keywords: Prefetch, | Triage Stage: prefetch_related, many-to-many | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Comment (by Simon Charette):
> I tried looking deeper into the QuerySet code to see if I can propose some patch. But it's rather complex code in there. I would search for the `_next_is_sticky()` token around `get_prefetch_querysets` implementations for many-to-many fields. It seems like we are already setting this flag in `ManyRelatedManager.get_prefetch_querysets` (can't link as Github is down) though so I'm surprised that the filter calls are not considered to be combined. -- Ticket URL: <https://code.djangoproject.com/ticket/35677#comment:3> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/0107019153319d6d-ffff4dcb-1b4d-495a-9c08-c6350f7526d3-000000%40eu-central-1.amazonses.com.