Skip to content

Instantly share code, notes, and snippets.

@cansadadeserfeliz
Created August 8, 2014 23:31
Show Gist options
  • Save cansadadeserfeliz/866f5b0fa2c2ea526cff to your computer and use it in GitHub Desktop.
Save cansadadeserfeliz/866f5b0fa2c2ea526cff to your computer and use it in GitHub Desktop.
Django: QuerySets
from itertools import chain
for item in chain(qs1, qs2, qs3):
# ...
res = qs1 | qs2 | qs3
res = res.distinct()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment