#24048: only() doesn't override fields included in defer() as documented
-------------------------------------+-------------------------------------
     Reporter:  wearp                |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  defer, only,         |             Triage Stage:  Accepted
  QuerySet, DeferredAttribute        |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by wearp):

 It looks as if the `only()`'s "problem" is caused by
 `add_immediate_loading()`. Taking the example above,
 `field_names.difference(existing)` in the method evaluates to
 `set(["value", "name"]).difference(set["name"])`.

 Cut a story short, `self.deferred_loading` is `set(["value"]), False` when
 it should be `set(["name", "value"]), False`.

 If the problem is to be fixed, is it best addressed in
 `add_immediate_loading()` or `only()`?

--
Ticket URL: <https://code.djangoproject.com/ticket/24048#comment:2>
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/063.3dce440829068da7e5c403b7ab3be251%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to