#14030: Use F() objects in aggregates(), annotates() and values()
-------------------------------------+-------------------------------------
     Reporter:  delfick              |                    Owner:  nate_b
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:  aggregate, annotate  |      Needs documentation:  1
    Has patch:  1                    |  Patch needs improvement:  1
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by tonnzor):

 * cc: tonnzor (added)


Comment:

 I would add one more use case here (as core devs proposed in #21738):

 {{{
 User.objects.annotate(new_is_active=SQL('CASE WHEN id > 100 THEN 1 ELSE 0
 END')).update(is_active=models.F('new_is_active'))
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/14030#comment:32>
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.a9fc0cca7ecce9e78106c2e7231bcc6d%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to