MCPcopy
hub / github.com/django/django / get_fallback_sql

Method get_fallback_sql

django/db/models/fields/tuple_lookups.py:152–162  ·  view source on GitHub ↗
(self, compiler, connection)

Source from the content-addressed store, hash-verified

150
151class TupleExact(TupleLookupMixin, Exact):
152 def get_fallback_sql(self, compiler, connection):
153 if isinstance(self.rhs, Query):
154 return super(TupleLookupMixin, self).as_sql(compiler, connection)
155 # Process right-hand-side to trigger sanitization.
156 self.process_rhs(compiler, connection)
157 # e.g.: (a, b, c) == (x, y, z) as SQL:
158 # WHERE a = x AND b = y AND c = z
159 lookups = [Exact(col, val) for col, val in zip(self.lhs, self.rhs)]
160 root = WhereNode(lookups, connector=AND)
161
162 return root.as_sql(compiler, connection)
163
164
165class TupleIsNull(TupleLookupMixin, IsNull):

Callers

nothing calls this directly

Calls 5

as_sqlMethod · 0.95
ExactClass · 0.90
WhereNodeClass · 0.90
as_sqlMethod · 0.45
process_rhsMethod · 0.45

Tested by

no test coverage detected