On Tue, May 12, 2009 at 1:53 AM, Malcolm Tredinnick <
malc...@pointy-stick.com> wrote:

>
> On Sat, 2009-05-09 at 20:18 -0700, Henry Andrews wrote:
> > Hi folks,
> >   When excluding using a subquery, I'm seeing the subquery being
> > executed first as its own query, then seeing the correct query being
> > run, including the subquery.  Using filter instead of exclude, this
> > does not happen.  Just wanted to see if I'm missing something obvious/
> > well known or if I should go ahead and file a bug (something I've not
> > yet done for Django :-)
>
> It looks like a bug. I can replicate it. I can kind of image how it's
> happening, too, now that I think about it. Please do file a ticket.
>
> Regards,
> Malcolm
>
>
>
> >
>
No one appears to have filed a ticket yet (I'll do it in a few minutes if no
one still has), but AFAICT the issue is here:
http://code.djangoproject.com/browser/django/trunk/django/db/models/sql/query.py#L1622
with the if not value triggering the issue.  It's probably solvable by
changing that to if (not hasattr(value, 'as_sql') and not hasattr(value,
'_as_sql') and not value), but I haven't spent a ton of time thinking about
it.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

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

Reply via email to