#17485: Queries with both deferred fields and select_related defer field.name
instead of field.attname
-------------------------------------+-------------------------------------
Reporter: koniiiik | Owner: koniiiik
Type: Bug | Status: reopened
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: defer | Needs documentation: 0
select_related | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by mrmachine):
* cc: real.human@… (added)
* status: closed => reopened
* resolution: fixed =>
Comment:
Looks like there's a bug in this commit that was not caught by the
included tests. When I try to use `only()` and `select_related()` and pass
the same fields to both, spanning multiple FKs I get an erroneous
exception telling me that I can't use `select_related` for a deferred
field. That's not what I'm doing. I'm using `select_related` for a field
that is explicitly NOT deferred.
I have written a patch with a new test, but I don't have a fix because I
don't fully understand what the code in this commit is doing.
--
Ticket URL: <https://code.djangoproject.com/ticket/17485#comment:12>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.