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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user