MCPcopy
hub / github.com/django/django / as_sql

Method as_sql

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

Source from the content-addressed store, hash-verified

129 )
130
131 def as_sql(self, compiler, connection):
132 if (
133 not connection.features.supports_tuple_comparison_against_subquery
134 and isinstance(self.rhs, Query)
135 and self.rhs.subquery
136 and isinstance(
137 self, (GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual)
138 )
139 ):
140 lookup = self.lookup_name
141 msg = (
142 f'"{lookup}" cannot be used to target composite fields '
143 "through subqueries on this backend"
144 )
145 raise NotSupportedError(msg)
146 if not connection.features.supports_tuple_lookups:
147 return self.get_fallback_sql(compiler, connection)
148 return super().as_sql(compiler, connection)
149
150
151class TupleExact(TupleLookupMixin, Exact):

Callers

nothing calls this directly

Calls 3

get_fallback_sqlMethod · 0.95
NotSupportedErrorClass · 0.90
as_sqlMethod · 0.45

Tested by

no test coverage detected