From 21f5dc467e3e05dfcdf6e0aedce8f680c7ba7f12 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Wed, 1 Dec 2010 17:53:22 +0000 Subject: [PATCH] Fixed a bug in date queries with GIS backends introduced in [14715]. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14760 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/gis/db/models/sql/compiler.py | 2 +- django/db/models/sql/subqueries.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/django/contrib/gis/db/models/sql/compiler.py b/django/contrib/gis/db/models/sql/compiler.py index 55dc4a66ec..dea0fd3e83 100644 --- a/django/contrib/gis/db/models/sql/compiler.py +++ b/django/contrib/gis/db/models/sql/compiler.py @@ -56,7 +56,7 @@ class GeoSQLCompiler(compiler.SQLCompiler): col_aliases.add(col[1]) else: result.append(col.as_sql(qn, self.connection)) - + if hasattr(col, 'alias'): aliases.add(col.alias) col_aliases.add(col.alias) diff --git a/django/db/models/sql/subqueries.py b/django/db/models/sql/subqueries.py index bb4b838b82..003bf432c0 100644 --- a/django/db/models/sql/subqueries.py +++ b/django/db/models/sql/subqueries.py @@ -202,7 +202,7 @@ class DateQuery(Query): alias = result[3][-1] select = Date((alias, field.column), lookup_type) self.select = [select] - self.select_fields = [] + self.select_fields = [None] self.select_related = False # See #7097. self.set_extra_mask([]) self.distinct = True