#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
-------------------------------------+-------------------------------------
Changes (by timgraham):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
* stage: Unreviewed => Accepted
Comment:
I checked back to 29050ef999e1931efb6c62471c7e07d2ea5e96ea where `defer()`
was added and this assertion in `tests/defer` (or its equivalent in the
original doc test) fails,
`self.assert_delayed(qs.defer("name").only("value", "name")[0], 1)` as
"name" is indeed deferred despite its inclusion in `only()`. It seems
expected to me that `only()` would override `defer()` so we should see
about making that change, but if we can't due to backwards compatibility
or implementation, we should definitely correct the docs.
--
Ticket URL: <https://code.djangoproject.com/ticket/24048#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 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.a534660e184c65e6c31c30538655671d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.