MCPcopy
hub / github.com/django/django / flatten

Method flatten

django/db/models/query_utils.py:156–169  ·  view source on GitHub ↗

Recursively yield this Q object and all subexpressions, in depth-first order.

(self)

Source from the content-addressed store, hash-verified

154 return clone
155
156 def flatten(self):
157 """
158 Recursively yield this Q object and all subexpressions, in depth-first
159 order.
160 """
161 yield self
162 for child in self.children:
163 if isinstance(child, tuple):
164 # Use the lookup.
165 child = child[1]
166 if hasattr(child, "flatten"):
167 yield from child.flatten()
168 else:
169 yield child
170
171 def check(self, against, using=DEFAULT_DB_ALIAS):
172 """

Callers 15

test_flattenMethod · 0.95
as_stringMethod · 0.45
as_bytesMethod · 0.45
resolve_expressionMethod · 0.45
checkMethod · 0.45
test_model_creationMethod · 0.45

Calls

no outgoing calls