> Then you'll need to use SQL. There's no way to do UNION in Django's
> ORM.
>
> An alternative is just to concatenate the two querysets:
> union = list(x) + list(y)
Or if the results are large and you don't want to consume double
the memory, you can use itertools.chain()
from itertools import chain
...
for thing in chain(x, y):
do_something(thing)
-tim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---