Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #1776 -- Fixed bug in DateQuerySet when the field is null. Than…

…ks, Christopher Lenz

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2857 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 71f45686137dc45717f41e145b260d960c4bb2e5 1 parent 0b73811
@adrianholovaty adrianholovaty authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/db/models/query.py
View
2  django/db/models/query.py
@@ -492,7 +492,7 @@ def iterator(self):
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' % \
Please sign in to comment.
Something went wrong with that request. Please try again.