﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
1776	[patch] DateQuerySet broken when date field allows NULL	Christopher Lenz <cmlenz@…>	Adrian Holovaty	"…which also breaks the `date_hierarchy` feature for such a field.

Patch is trivial:
{{{
Index: django/db/models/query.py
===================================================================
--- django/db/models/query.py   (revision 393)
+++ django/db/models/query.py   (working copy)
@@ -478,7 +478,7 @@
         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' % \
}}}
"	defect	closed	Core (Other)	dev	normal	fixed			Unreviewed	1	0	0	0	0	0
