#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:  0
Easy pickings:  0                    |                    UI/UX:  0

Comment (by Aivars Kalvāns):

 Yes I saw it. But I did not see there a way to implement the new behavior
 without breaking the API. Is there something I missed? Returning a tuple
 with {{{(n, [data])}}} will break the code that expects a simple integer,
 making the {{{returning}}} kwarg special also can break something (but
 unlikely) and chaining of method calls like {{{.update().value()}}} is not
 possible because the update is expected to execute the SQL before

 So asides from naming the function I think that returning models by
 default is nice because it includes PK and the result is "usable". If you
 don't need the models, you can ask for values or values_list. There are
 people using {{{QuerySet.raw()}}} to achieve similar result

Ticket URL: <https://code.djangoproject.com/ticket/32406#comment:16>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to