From 05232cda2fd4cd0209b51ee4573aac1e84ac4def Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Sun, 29 Oct 2017 23:22:26 +0500 Subject: [PATCH] [2.0.x] Simplified GeometryField.select_format(). Backport of e9a370bb6a8bbe824f62b4c59364c1e0b105282f from master --- django/contrib/gis/db/backends/base/operations.py | 2 +- django/contrib/gis/db/models/fields.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/django/contrib/gis/db/backends/base/operations.py b/django/contrib/gis/db/backends/base/operations.py index af85b83df6b..734526d425b 100644 --- a/django/contrib/gis/db/backends/base/operations.py +++ b/django/contrib/gis/db/backends/base/operations.py @@ -16,7 +16,7 @@ class BaseSpatialOperations: spatial_version = None # How the geometry column should be selected. - select = None + select = '%s' @cached_property def select_extent(self): diff --git a/django/contrib/gis/db/models/fields.py b/django/contrib/gis/db/models/fields.py index 8278f712669..e43d7ccc2ed 100644 --- a/django/contrib/gis/db/models/fields.py +++ b/django/contrib/gis/db/models/fields.py @@ -266,8 +266,7 @@ class GeometryField(BaseSpatialField): of the spatial backend. For example, Oracle and MySQL require custom selection formats in order to retrieve geometries in OGC WKB. """ - select = compiler.connection.ops.select - return select % sql if select else sql, params + return compiler.connection.ops.select % sql, params # The OpenGIS Geometry Type Fields