#24048: potential bug with defer() and only()
-------------------------------------+-------------------------------------
     Reporter:  wearp                |      Owner:  nobody
         Type:  Bug                  |     Status:  new
    Component:  Database layer       |    Version:  master
  (models, ORM)                      |   Keywords:  defer, only, QuerySet,
     Severity:  Normal               |  DeferredAttribute
 Triage Stage:  Unreviewed           |  Has patch:  0
Easy pickings:  0                    |      UI/UX:  0
-------------------------------------+-------------------------------------
 The docs give the following example for the `QuerySet` API's `only`:

 {{{
 # Final result loads headline and body immediately (only() replaces any
 # existing set of fields).
 Entry.objects.defer("body").only("headline", "body")
 }}}

 
https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.only

 I understand this to mean that "body" will be loaded i.e. not a deferred
 field. When testing this, however, "body" is still considered a
 `DeferredAttribute`.  Is this a possible bug or does the documentation
 need changing?

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

Reply via email to