MCPcopy
hub / github.com/django/django / process_distance

Method process_distance

django/contrib/gis/db/models/lookups.py:338–349  ·  view source on GitHub ↗
(self, compiler, connection)

Source from the content-addressed store, hash-verified

336 sql_template = "%(func)s(%(lhs)s, %(rhs)s, %(value)s)"
337
338 def process_distance(self, compiler, connection):
339 dist_param = self.rhs_params[0]
340 if (
341 not connection.features.supports_dwithin_distance_expr
342 and hasattr(dist_param, "resolve_expression")
343 and not isinstance(dist_param, Distance)
344 ):
345 raise NotSupportedError(
346 "This backend does not support expressions for specifying "
347 "distance in the dwithin lookup."
348 )
349 return super().process_distance(compiler, connection)
350
351 def process_rhs(self, compiler, connection):
352 dist_sql, dist_params = self.process_distance(compiler, connection)

Callers 2

process_rhsMethod · 0.95
as_sqlMethod · 0.45

Calls 1

NotSupportedErrorClass · 0.90

Tested by

no test coverage detected