summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2017-03-25 22:09:34 +0500
committerTim Graham <timograham@gmail.com>2017-03-25 13:09:34 -0400
commit7fffe3acc29f99b4a8b23e7b5cc344454d20efb5 (patch)
tree76ac454510563ce187efb8591c77228b36bcd433
parent24d40e7e0c52e0262b182abb9d4116157bcfe6a8 (diff)
Removed unused GISLookup._check_geo_field().
Unused since a0d166306fbdc41f49e6fadf4ec84b17eb147daa.
-rw-r--r--django/contrib/gis/db/models/lookups.py42
1 files changed, 0 insertions, 42 deletions
diff --git a/django/contrib/gis/db/models/lookups.py b/django/contrib/gis/db/models/lookups.py
index 58ca90072e..489eef1728 100644
--- a/django/contrib/gis/db/models/lookups.py
+++ b/django/contrib/gis/db/models/lookups.py
@@ -1,7 +1,5 @@
import re
-from django.core.exceptions import FieldDoesNotExist
-from django.db.models.constants import LOOKUP_SEP
from django.db.models.expressions import Col, Expression
from django.db.models.lookups import Lookup, Transform
from django.db.models.sql.query import Query
@@ -25,46 +23,6 @@ class GISLookup(Lookup):
super().__init__(*args, **kwargs)
self.template_params = {}
- @classmethod
- def _check_geo_field(cls, opts, lookup):
- """
- Check the given lookup with the given model options.
- The lookup is a string either specifying the geographic field, e.g.
- 'point, 'the_geom', or a related lookup on a geographic field like
- 'address__point'.
-
- Return a BaseSpatialField if one exists according to the given lookup
- on the model options, otherwise return None.
- """
- from django.contrib.gis.db.models.fields import BaseSpatialField
- # This takes into account the situation where the lookup is a
- # lookup to a related geographic field, e.g., 'address__point'.
- field_list = lookup.split(LOOKUP_SEP)
-
- # Reversing so list operates like a queue of related lookups,
- # and popping the top lookup.
- field_list.reverse()
- fld_name = field_list.pop()
-
- try:
- geo_fld = opts.get_field(fld_name)
- # If the field list is still around, then it means that the
- # lookup was for a geometry field across a relationship --
- # thus we keep on getting the related model options and the
- # model field associated with the next field in the list
- # until there's no more left.
- while len(field_list):
- opts = geo_fld.remote_field.model._meta
- geo_fld = opts.get_field(field_list.pop())
- except (FieldDoesNotExist, AttributeError):
- return False
-
- # Finally, make sure we got a Geographic field and return.
- if isinstance(geo_fld, BaseSpatialField):
- return geo_fld
- else:
- return False
-
def process_band_indices(self, only_lhs=False):
"""
Extract the lhs band index from the band transform class and the rhs