#15624: aggregate produces incorrect sql statement
-------------------------------------+-------------------------------------
     Reporter:  zeroos <232002@…>    |                    Owner:  fhahn
         Type:  Bug                  |                   Status:  assigned
    Component:  ORM aggregation      |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  aggregate sql        |             Triage Stage:  Accepted
  syntax error                       |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by fhahn):

 * cc: flo@… (added)
 * owner:   => fhahn
 * status:  new => assigned
 * needs_tests:  1 => 0


Comment:

 I think the problem with {{{
 Book.objects.annotate(c=Count('authors')).values('c').aggregate(Max('c'))
 }}} was that the call to {{{ .values('c') }}} set the {{{
 aggregates_select_mask }}} to {{{ set(['c']) }}} and then {{{ c__max }}}
 does not show up in {{{ aggregate_select }}}.

 I've updated the patch and created a pull request:
 https://github.com/django/django/pull/738

-- 
Ticket URL: <https://code.djangoproject.com/ticket/15624#comment:9>
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].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to