#24048: only() doesn't override fields included in defer() as documented
-------------------------------------+-------------------------------------
     Reporter:  Will Earp            |                    Owner:  Ryan
                                     |  Cheley
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  dev
  (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 Ryan Cheley):

 It does appear that there is a contradiction in the `only()` method doc
 string when compared to the
 
[https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.only|
 documentation ]

 Since the doc string for the method is correct AND making changes to the
 way that the `defer()` and `only()` function **now** may break things for
 code bases that are already in production, I believe that the
 documentation should be updated to clearly state what is happening, i.e.
 that the use of `defer()` with `only()` will result in `defer()`
 overriding `only()` for fields that are listed in both.

 I'm still working out how to express that though. Once done, I'll submit a
 PR to update the docs and reference this ticket.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/24048#comment:8>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018405778737-1a929ff8-c4c3-4a48-ba4b-2f081cdde7ef-000000%40eu-central-1.amazonses.com.

Reply via email to