Loading django/contrib/gis/db/backends/base/operations.py +5 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,11 @@ class BaseSpatialOperations(object): """ raise NotImplementedError('subclasses of BaseSpatialOperations must provide a geo_db_placeholder() method') def check_aggregate_support(self, aggregate): if aggregate.contains_aggregate == 'gis': return aggregate.name in self.valid_aggregates return super(BaseSpatialOperations, self).check_aggregate_support(aggregate) # Spatial SQL Construction def spatial_aggregate_sql(self, agg): raise NotImplementedError('Aggregate support not implemented for this spatial backend.') Loading django/contrib/gis/db/backends/mysql/operations.py +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ from django.contrib.gis.db.backends.utils import SpatialOperator from django.db.backends.mysql.operations import DatabaseOperations class MySQLOperations(DatabaseOperations, BaseSpatialOperations): class MySQLOperations(BaseSpatialOperations, DatabaseOperations): mysql = True name = 'mysql' Loading django/contrib/gis/db/backends/oracle/operations.py +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ class SDORelate(SpatialOperator): return super(SDORelate, self).as_sql(connection, lookup, template_params, sql_params) class OracleOperations(DatabaseOperations, BaseSpatialOperations): class OracleOperations(BaseSpatialOperations, DatabaseOperations): name = 'oracle' oracle = True Loading django/contrib/gis/db/backends/postgis/operations.py +1 −9 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ class PostGISDistanceOperator(PostGISOperator): return super(PostGISDistanceOperator, self).as_sql(connection, lookup, template_params, sql_params) class PostGISOperations(DatabaseOperations, BaseSpatialOperations): class PostGISOperations(BaseSpatialOperations, DatabaseOperations): name = 'postgis' postgis = True geography = True Loading Loading @@ -179,14 +179,6 @@ class PostGISOperations(DatabaseOperations, BaseSpatialOperations): version = vtup[1:] return version def check_aggregate_support(self, aggregate): """ Checks if the given aggregate name is supported (that is, if it's in `self.valid_aggregates`). """ agg_name = aggregate.__class__.__name__ return agg_name in self.valid_aggregates def convert_extent(self, box, srid): """ Returns a 4-tuple extent for the `Extent` aggregate by converting Loading django/contrib/gis/db/backends/spatialite/operations.py +1 −10 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ from django.utils import six from django.utils.functional import cached_property class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations): class SpatiaLiteOperations(BaseSpatialOperations, DatabaseOperations): name = 'spatialite' spatialite = True version_regex = re.compile(r'^(?P<major>\d)\.(?P<minor1>\d)\.(?P<minor2>\d+)') Loading Loading @@ -121,15 +121,6 @@ class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations): def geojson(self): return 'AsGeoJSON' if self.spatial_version >= (3, 0, 0) else None def check_aggregate_support(self, aggregate): """ Checks if the given aggregate name is supported (that is, if it's in `self.valid_aggregates`). """ super(SpatiaLiteOperations, self).check_aggregate_support(aggregate) agg_name = aggregate.__class__.__name__ return agg_name in self.valid_aggregates def convert_extent(self, box, srid): """ Convert the polygon data received from Spatialite to min/max values. Loading Loading
django/contrib/gis/db/backends/base/operations.py +5 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,11 @@ class BaseSpatialOperations(object): """ raise NotImplementedError('subclasses of BaseSpatialOperations must provide a geo_db_placeholder() method') def check_aggregate_support(self, aggregate): if aggregate.contains_aggregate == 'gis': return aggregate.name in self.valid_aggregates return super(BaseSpatialOperations, self).check_aggregate_support(aggregate) # Spatial SQL Construction def spatial_aggregate_sql(self, agg): raise NotImplementedError('Aggregate support not implemented for this spatial backend.') Loading
django/contrib/gis/db/backends/mysql/operations.py +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ from django.contrib.gis.db.backends.utils import SpatialOperator from django.db.backends.mysql.operations import DatabaseOperations class MySQLOperations(DatabaseOperations, BaseSpatialOperations): class MySQLOperations(BaseSpatialOperations, DatabaseOperations): mysql = True name = 'mysql' Loading
django/contrib/gis/db/backends/oracle/operations.py +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ class SDORelate(SpatialOperator): return super(SDORelate, self).as_sql(connection, lookup, template_params, sql_params) class OracleOperations(DatabaseOperations, BaseSpatialOperations): class OracleOperations(BaseSpatialOperations, DatabaseOperations): name = 'oracle' oracle = True Loading
django/contrib/gis/db/backends/postgis/operations.py +1 −9 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ class PostGISDistanceOperator(PostGISOperator): return super(PostGISDistanceOperator, self).as_sql(connection, lookup, template_params, sql_params) class PostGISOperations(DatabaseOperations, BaseSpatialOperations): class PostGISOperations(BaseSpatialOperations, DatabaseOperations): name = 'postgis' postgis = True geography = True Loading Loading @@ -179,14 +179,6 @@ class PostGISOperations(DatabaseOperations, BaseSpatialOperations): version = vtup[1:] return version def check_aggregate_support(self, aggregate): """ Checks if the given aggregate name is supported (that is, if it's in `self.valid_aggregates`). """ agg_name = aggregate.__class__.__name__ return agg_name in self.valid_aggregates def convert_extent(self, box, srid): """ Returns a 4-tuple extent for the `Extent` aggregate by converting Loading
django/contrib/gis/db/backends/spatialite/operations.py +1 −10 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ from django.utils import six from django.utils.functional import cached_property class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations): class SpatiaLiteOperations(BaseSpatialOperations, DatabaseOperations): name = 'spatialite' spatialite = True version_regex = re.compile(r'^(?P<major>\d)\.(?P<minor1>\d)\.(?P<minor2>\d+)') Loading Loading @@ -121,15 +121,6 @@ class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations): def geojson(self): return 'AsGeoJSON' if self.spatial_version >= (3, 0, 0) else None def check_aggregate_support(self, aggregate): """ Checks if the given aggregate name is supported (that is, if it's in `self.valid_aggregates`). """ super(SpatiaLiteOperations, self).check_aggregate_support(aggregate) agg_name = aggregate.__class__.__name__ return agg_name in self.valid_aggregates def convert_extent(self, box, srid): """ Convert the polygon data received from Spatialite to min/max values. Loading