MCPcopy
hub / github.com/django/django / union

Method union

django/db/models/query.py:1712–1723  ·  view source on GitHub ↗
(self, *other_qs, all=False)

Source from the content-addressed store, hash-verified

1710 return clone
1711
1712 def union(self, *other_qs, all=False):
1713 # If the query is an EmptyQuerySet, combine all nonempty querysets.
1714 if isinstance(self, EmptyQuerySet):
1715 qs = [q for q in other_qs if not isinstance(q, EmptyQuerySet)]
1716 if not qs:
1717 return self
1718 if len(qs) == 1:
1719 return qs[0]
1720 return qs[0]._combinator_query("union", *qs[1:], all=all)
1721 elif not other_qs:
1722 return self
1723 return self._combinator_query("union", *other_qs, all=all)
1724
1725 def intersection(self, *other_qs):
1726 # If any query is an EmptyQuerySet, return it.

Callers 15

decoratorFunction · 0.45
wrapperFunction · 0.45
test_match_tagsFunction · 0.45
bump_prefixMethod · 0.45
add_deferred_loadingMethod · 0.45
test_simple_unionMethod · 0.45

Calls 1

_combinator_queryMethod · 0.95