There are two problems in the current implementation:
- The way user-defined .values() and Django issued .values() in
build_filter() is detected is ugly
- There is no multidb protection (test_subquery in
multiple_database.tests.QueryTestCase) fails).
I'll mark this as accepted directly in the sense of "worth doing if above
problems can be addressed).
--
Ticket URL: <https://code.djangoproject.com/ticket/20939>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Tim Graham):
I rebased and updated this to see if it's still worth doing and to learn
something in the process. It's still incomplete and tests aren't passing:
[https://github.com/django/django/pull/7289 PR].
--
Ticket URL: <https://code.djangoproject.com/ticket/20939#comment:1>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"1bc249c2a67c24fcd28436c85388eff1d826e305" 1bc249c]:
{{{
#!CommitTicketReference repository=""
revision="1bc249c2a67c24fcd28436c85388eff1d826e305"
Fixed #20939 -- Simplified query generation by converting QuerySet to
Query.
Thanks Anssi Kääriäinen for the initial patch and Anssi, Simon Charette,
and Josh Smeaton for review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20939#comment:2>
Comment (by Simon Charette <charette.s@…>):
In [changeset:"ec50937bcbe160e658ef881021402e156beb0eaf" ec50937]:
{{{
#!CommitTicketReference repository=""
revision="ec50937bcbe160e658ef881021402e156beb0eaf"
Refs #20939 -- Removed the Query._forced_pk hack.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20939#comment:3>
Comment (by Simon Charette <charette.s@…>):
In [changeset:"c9159a082ebe41a1f735f8d01720e746fb43c41e" c9159a08]:
{{{
#!CommitTicketReference repository=""
revision="c9159a082ebe41a1f735f8d01720e746fb43c41e"
Refs #20939 -- Removed the Query._prepare_as_filter_value() hack.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20939#comment:4>
Comment (by Simon Charette <charette.s@…>):
In [changeset:"e62ea0bb9cbb54c1eef848871fe3eab2bad268dc" e62ea0bb]:
{{{
#!CommitTicketReference repository=""
revision="e62ea0bb9cbb54c1eef848871fe3eab2bad268dc"
Refs #20939 -- Moved subquery ordering clearing optimization to the __in
lookup.
Queries could potentially be resolved in cases where ordering matter.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20939#comment:5>
Comment (by Tim Graham <timograham@…>):
In [changeset:"eb4724a0632928bda2a512a9117a91260096e457" eb4724a0]:
{{{
#!CommitTicketReference repository=""
revision="eb4724a0632928bda2a512a9117a91260096e457"
Reverted "Refs #20939 -- Moved subquery ordering clearing optimization to
the __in lookup."
This reverts commit e62ea0bb9cbb54c1eef848871fe3eab2bad268dc since it
broke multi-column __in lookups and _meta.order_wrt on Oracle.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20939#comment:6>