#24692: QuerySet.extra(select=...) is silently dropped with aggregations
-------------------------------------+-------------------------------------
     Reporter:  jdelic               |                    Owner:  nobody
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  Database layer       |                  Version:  1.8
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by jarshwah):

 I agree with your analysis shaib. I've just tried a few things to see if I
 can work around the problem, but no I can't. Adding the extra clause at
 the end of the .values().annotate() also drops the extra, which is
 somewhat concerning, but it wouldn't work anyway.

 > Well, there will always be edge cases where any ORM will not work, I
 guess.

 Yes, and that is why users can now build their own expressions with full
 support of the ORM.

 At a maximum we could maybe document that extra does not play well with
 aggregation, but I can't see us implementing a fix here without turning
 "extra" into the new expressions api anyway.

--
Ticket URL: <https://code.djangoproject.com/ticket/24692#comment:11>
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/064.9875cc52a18a94ad92b4cfa63aefff38%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to