From 08df3dd937ce264c07117b10eae9a55651a63b43 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Fri, 7 Apr 2017 16:38:56 +0500 Subject: [PATCH] Removed more GeoQuerySet leftovers. Follow up to a0d166306fbdc41f49e6fadf4ec84b17eb147daa. --- .../gis/db/backends/oracle/operations.py | 3 +- django/contrib/gis/db/models/sql/__init__.py | 4 +- .../contrib/gis/db/models/sql/conversion.py | 41 ------------------- 3 files changed, 3 insertions(+), 45 deletions(-) diff --git a/django/contrib/gis/db/backends/oracle/operations.py b/django/contrib/gis/db/backends/oracle/operations.py index cbe90d6f53..926209ac40 100644 --- a/django/contrib/gis/db/backends/oracle/operations.py +++ b/django/contrib/gis/db/backends/oracle/operations.py @@ -125,8 +125,7 @@ class OracleOperations(BaseSpatialOperations, DatabaseOperations): geometry_fields = ( 'PointField', 'GeometryField', 'LineStringField', 'PolygonField', 'MultiPointField', 'MultiLineStringField', - 'MultiPolygonField', 'GeometryCollectionField', 'GeomField', - 'GMLField', + 'MultiPolygonField', 'GeometryCollectionField', ) if internal_type in geometry_fields: converters.append(self.convert_textfield_value) diff --git a/django/contrib/gis/db/models/sql/__init__.py b/django/contrib/gis/db/models/sql/__init__.py index d2a4f703e8..850c644d5d 100644 --- a/django/contrib/gis/db/models/sql/__init__.py +++ b/django/contrib/gis/db/models/sql/__init__.py @@ -1,7 +1,7 @@ from django.contrib.gis.db.models.sql.conversion import ( - AreaField, DistanceField, GeomField, GMLField, + AreaField, DistanceField, ) __all__ = [ - 'AreaField', 'DistanceField', 'GeomField', 'GMLField' + 'AreaField', 'DistanceField', ] diff --git a/django/contrib/gis/db/models/sql/conversion.py b/django/contrib/gis/db/models/sql/conversion.py index 75e4adaccf..3ba96a41cc 100644 --- a/django/contrib/gis/db/models/sql/conversion.py +++ b/django/contrib/gis/db/models/sql/conversion.py @@ -4,22 +4,10 @@ database. """ from decimal import Decimal -from django.contrib.gis.db.models.fields import GeoSelectFormatMixin -from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.measure import Area, Distance from django.db import models -class BaseField: - empty_strings_allowed = True - - def get_db_converters(self, connection): - return [self.from_db_value] - - def select_format(self, compiler, sql, params): - return sql, params - - class AreaField(models.FloatField): "Wrapper for Area values." def __init__(self, area_att=None): @@ -73,32 +61,3 @@ class DistanceField(models.FloatField): def get_internal_type(self): return 'DistanceField' - - -class GeomField(GeoSelectFormatMixin, BaseField): - """ - Wrapper for Geometry values. It is a lightweight alternative to - using GeometryField (which requires an SQL query upon instantiation). - """ - # Hacky marker for get_db_converters() - geom_type = None - - def from_db_value(self, value, expression, connection, context): - if value is not None: - value = Geometry(value) - return value - - def get_internal_type(self): - return 'GeometryField' - - -class GMLField(BaseField): - """ - Wrapper for GML to be used by Oracle to ensure Database.LOB conversion. - """ - - def get_internal_type(self): - return 'GMLField' - - def from_db_value(self, value, expression, connection, context): - return value