#17485: Queries with both deferred fields and select_related defer field.name
instead of field.attname
-------------------------------------+-------------------------------------
     Reporter:  koniiiik             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  SVN
  (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 aaugustin):

 * needs_better_patch:   => 0
 * needs_docs:   => 0
 * needs_tests:   => 0
 * stage:  Unreviewed => Accepted


Comment:

 You've clearly demonstrated that this is a bug: Django misbehaves badly in
 this situation.

 It seems to me that `select_related` is the opposite of `defer`. Is there
 a use case for using both on the same field? Maybe it's
 `.defer('foo').select_related('foo__bar__baz')`, in order to fetch `foo`,
 `bar` and `baz` in one query on the first access to `foo`? (Does that
 actually work?)

 Anyway, I think we should fix the bug and all affected tests with one
 patch.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17485#comment:1>
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 this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to