On Apr 24, 6:05 pm, Karen Tracey <kmtra...@gmail.com> wrote:
> I'd start by using a couple of Python shells (one using 1.0.2 and one using
> 1.1 beta) and connection.queries to see if you can see the difference in SQL
> generated for whatever model queries your view is using:
>
> http://docs.djangoproject.com/en/dev/faq/models/
>
> Karen

Hi Karen,

I wouldn't have written the post if I had not already done that. At
least so I thought. Comparing the resulting queries once more, I found
the difference. Django is using subselects now.
http://docs.djangoproject.com/en/dev/ref/models/querysets/#in

In my code, I just used a queryset as parameter for __in and in
previous Django versions it would evaluate to a list of numbers
whereas now it does a subselect. I don't think that's very backwards
compatible.

Reading the part "Performance considerations" got me in the right
direction but didn't help me very well, because if you do it like
that, it will still do a subselect. I had to explicitly rewrite the
ValuesListQuerySet to a list to really get a list of IDs into my
query. Looks like a bug, but I'm too busy to confirm that right now.

Julian
--~--~---------~--~----~------------~-------~--~----~
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