#25643: Allow update() with aggregates and joins via subqueries
-------------------------------------+-------------------------------------
     Reporter:  jorgecarleitao       |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by jarshwah):

 * needs_docs:   => 0
 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * stage:  Unreviewed => Accepted


Comment:

 Expressions work in `update()` and now also `create()` too. What (I think)
 you're asking for here is to support aggregates in update queries by
 pushing the aggregate portion into a subquery. Supporting joins in an
 update query is also related, and would require either subqueries or an
 `UPDATE .. FROM .. ` syntax that I think only SQL Server supports (so
 let's forget that!).

 I'm not sure what capabilities the ORM has with regard to detecting and
 then pushing aggregates down into subqueries though, so this is probably
 going to be a difficult thing to implement. Anssi would probably have a
 better idea on the capabilities.

 Regardless though, it's supported in SQL so we should try to support it
 too.

--
Ticket URL: <https://code.djangoproject.com/ticket/25643#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/072.8a4f4e7e963597434c5a2f004510afd5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to