What is the current thinking about whether/when the ORM will be
extended to allow formulation of correlated and dynamic subqueries
without requiring raw SQL?

My motivation right now is that I have a few queries that are probably
best expressed using correlated "EXISTS (SELECT ...)" or "...  IN
(SELECT ...)" subqueries in the where clause of the main query. For
simple cases, these kinds of subqueries could be implemented using
QuerySet.extra(), but since I want to build subqueries with
dynamically generated where clauses, it would be nice to be able to be
able to build on the work that has already been put into the
QuerySet.filter(), .exclude(), Q, etc. to create the correlated
subqueries.

A search of the group archives turned up some discussion of
subqueries, but I did not come across anything that directly addresses
queries of this form.

After looking through some of the code in django/db/models/query.py, I
think I could probably come up with one or two QOperator subclasses
that do what I want, but I figured it would be worthwhile to ask.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to