#25496: ModelChoiceField generates extra queries by not respecting
prefetch_related
-----------------------------+--------------------------------------
Reporter: mdentremont | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version:
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------------------------
Changes (by charettes):
* status: closed => new
* type: Uncategorized => Bug
* resolution: duplicate =>
Comment:
Hmm it looks like it might be a regression in `1.8` by the fix for #23623
(fa534b92dda0771661a98a1ca302ced264d0a6da) which introduced the use of
`iterator()` to reduce memory usage.
From the `prefetch_related`
[https://docs.djangoproject.com/en/1.8/ref/models/querysets/#prefetch-
related docs]
> Note that if you use `iterator()` to run the query, `prefetch_related()`
calls will be ignored since these two optimizations do not make sense
together.
--
Ticket URL: <https://code.djangoproject.com/ticket/25496#comment:5>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/069.0b7ca9a4b4c1694e803d9fb60fb055af%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.