#32704: QuerySet.defer() doesn't clear deferred field when chaining with only().
-------------------------------------+-------------------------------------
Reporter: Manuel Baclet | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: defer only | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mariusz Felisiak):
> - calls to `.defer()` cannot remove items from the deferred set and
evaluating `qs.defer("some_field")` should never fetch the column
`"some_field"` (since this should add `"some_field"` to the deferred set)
Feel-free to propose a docs clarification (see also #24048).
> - the querysets `qs.defer("field1").defer("field2")` and
`qs.defer("field1", "field2")` should be equivalent
That's why I accepted
`Company.objects.only("name").defer("name").defer("country")` as a bug.
--
Ticket URL: <https://code.djangoproject.com/ticket/32704#comment:4>
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/064.f445090463700984c0b79b051831c7c1%40djangoproject.com.