On Wed, Jul 7, 2010 at 5:06 PM, Jeff Green <jeffhg2...@gmail.com> wrote:
> When I combine two query sets I use the chain command. You might want to try
> it.
>
> Here is my code snippet
>
> from itertools import chain

chain is useful when you want to concatenate two lists together. In
this case though, I want distinct objects, ordered correctly by the
database server, which is what combining the querysets with the |
operator gives me.

I just still can't understand why this works:

qs = qs2 | qs1

and this does not:

qs = qs1 | qs2

and would prefer to understand so I can leave an appropriate comment
in the code for the next soul to touch this code, rather than a # XXX
HERE BE DRAGONS

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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