SIGN IN SIGN UP

perf(api): Prefetch reverse many-to-many serializer fields (#23064)

Recognize Django's ManyToManyRel in get_prefetches_for_serializer().
Because it is a sibling of ManyToOneRel rather than a subclass, reverse
many-to-many accessors were omitted from the generated prefetch paths and
fetched once per serialized object.

Add regression coverage for both automatically generated fields and
SerializedPKRelatedField(many=True), and regenerate the affected ASN and
ObjectPermission API query-count baselines.

Fixes #23060
M
Martin Hauser committed
2b3b9e62e7fa2e36067ab2df72060996dec801a2
Parent: 0f22d67
Committed by GitHub <noreply@github.com> on 8/31/2026, 5:15:21 PM