1
0
mirror of https://github.com/django/django.git synced 2025-10-29 00:26:07 +00:00

Fixed #7155 -- Corrected DateQuerySet to handle nullable fields. Thanks to fcaprioli@alice.it for the original report and patch, and to Jeremy Dunck for the test case.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7739 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2008-06-25 13:38:06 +00:00
parent 87a704cf50
commit b8f7b39ccc
2 changed files with 7 additions and 2 deletions

View File

@@ -690,7 +690,7 @@ class DateQuerySet(QuerySet):
self.query.select = []
self.query.add_date_select(self._field.column, self._kind, self._order)
if self._field.null:
self.query.add_filter(('%s__isnull' % self._field.name, True))
self.query.add_filter(('%s__isnull' % self._field.name, False))
def _clone(self, klass=None, setup=False, **kwargs):
c = super(DateQuerySet, self)._clone(klass, False, **kwargs)