#29214: Invalid SQL generated when annotating a subquery with an outerref to an
annotated field.
-------------------------------------+-------------------------------------
     Reporter:  Oskar Persson        |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  queryset             |             Triage Stage:  Accepted
  annotations                        |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Chetan Khanna):

 That comment was really insightful, thank you! :)

 If you don't mind confirming, then this is what I could get from the
 comment:
 Whenever there is a `filter()` clause, preceding an `update()` clause, and
 containing fields from related models joined via `__`,  the ORM gives back
 a SQL with an `INNER JOIN` inside a subquery. And for this issue, we want
 to have a similar functionality in the `OuterRef` that contain `__`.

 If so, I think I  have created a test from our test suite that might serve
 as a starting point.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29214#comment:13>
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 
https://groups.google.com/d/msgid/django-updates/070.5cf2f687bad87f635cf891e352aeb539%40djangoproject.com.

Reply via email to