summaryrefslogtreecommitdiff
path: root/django/db/models/sql/subqueries.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-09-28 04:36:10 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-09-28 04:36:10 +0000
commitbaa960209f4f946d333987fbabcf13d26abfeb89 (patch)
tree9c4df44dcda51dbe8c85c10c63fe09d9533cd534 /django/db/models/sql/subqueries.py
parent4eb26b1659dbb3034c85df34758992b1b5601f73 (diff)
Fixed Queryset.dates() in the presence of extra-select columns.
Any extra(select=...) columns can be ignored in the SQL for dates, since we are only interested in extracting distinct date values. We were previously including them by accident and it was generating incorrect SQL. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/sql/subqueries.py')
-rw-r--r--django/db/models/sql/subqueries.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/django/db/models/sql/subqueries.py b/django/db/models/sql/subqueries.py
index 77b5d6cf37..8a2493e80f 100644
--- a/django/db/models/sql/subqueries.py
+++ b/django/db/models/sql/subqueries.py
@@ -394,6 +394,7 @@ class DateQuery(Query):
self.select = [select]
self.select_fields = [None]
self.select_related = False # See #7097.
+ self.extra_select = {}
self.distinct = True
self.order_by = order == 'ASC' and [1] or [-1]