MCPcopy
hub / github.com/django/django / as_postgresql

Method as_postgresql

django/contrib/gis/db/models/functions.py:544–553  ·  view source on GitHub ↗
(self, compiler, connection, **extra_context)

Source from the content-addressed store, hash-verified

542 arity = 1
543
544 def as_postgresql(self, compiler, connection, **extra_context):
545 function = None
546 if self.geo_field.geodetic(connection) and not self.source_is_geography():
547 raise NotSupportedError(
548 "ST_Perimeter cannot use a non-projected non-geography field."
549 )
550 dim = min(f.dim for f in self.get_source_fields())
551 if dim > 2:
552 function = connection.ops.perimeter3d
553 return super().as_sql(compiler, connection, function=function, **extra_context)
554
555 def as_sqlite(self, compiler, connection, **extra_context):
556 if self.geo_field.geodetic(connection):

Callers

nothing calls this directly

Calls 5

NotSupportedErrorClass · 0.90
geodeticMethod · 0.80
source_is_geographyMethod · 0.80
get_source_fieldsMethod · 0.45
as_sqlMethod · 0.45

Tested by

no test coverage detected