summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-05-06 18:35:51 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-05-06 18:35:51 +0000
commit71f45686137dc45717f41e145b260d960c4bb2e5 (patch)
tree4bf6d16ec49732cf4a1a14c85e21330b20c34541
parent0b73811e26e3c06e6ce8c2f1df7d1c97673dd08a (diff)
Fixed #1776 -- Fixed bug in DateQuerySet when the field is null. Thanks, Christopher Lenz
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2857 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/models/query.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py
index 4173939693..096e414a39 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -492,7 +492,7 @@ class DateQuerySet(QuerySet):
from django.db.backends.util import typecast_timestamp
self._order_by = () # Clear this because it'll mess things up otherwise.
if self._field.null:
- date_query._where.append('%s.%s IS NOT NULL' % \
+ self._where.append('%s.%s IS NOT NULL' % \
(backend.quote_name(self.model._meta.db_table), backend.quote_name(self._field.column)))
select, sql, params = self._get_sql_clause()
sql = 'SELECT %s %s GROUP BY 1 ORDER BY 1 %s' % \