#32406: Allow QuerySet.update() to return fields on supported backends.
-------------------------------------+-------------------------------------
Reporter: Tom Carrick | Owner: Aivars
| KalvÄns
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):
For those interested in this feature I'd really appreciate feedback on
comment:23.
An alternative could be to allow `values` and `values_list` chaining so
the following would work
{{{#!python
Author.objects.values_list(Age("dob"),
flat=True).update(dob=timezone.now(), returning=True)
>>> [(35,)]
Author.objects.values().update(dob=timezone.now(), returning=["dob"])
>>> [{"dob": date(...)}] # returning: list has precedence over values()
mask
Author.objects.update(dob=timezone.now())
>>> [Author(id=123)] # Author instances with no fields deferred
Author.objects.update(dob=timezone.now(), returning=["dob"])
>>> [Author(id=123)] # Author instances with all fields but dob deferred
--
Ticket URL: <https://code.djangoproject.com/ticket/32406#comment:27>
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 visit
https://groups.google.com/d/msgid/django-updates/0107019e5a71e009-ece9ee01-52be-4da7-a189-d466563807c6-000000%40eu-central-1.amazonses.com.