mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -492,7 +492,7 @@ class DateQuerySet(QuerySet): | |||||||
|         from django.db.backends.util import typecast_timestamp |         from django.db.backends.util import typecast_timestamp | ||||||
|         self._order_by = () # Clear this because it'll mess things up otherwise. |         self._order_by = () # Clear this because it'll mess things up otherwise. | ||||||
|         if self._field.null: |         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))) |                 (backend.quote_name(self.model._meta.db_table), backend.quote_name(self._field.column))) | ||||||
|         select, sql, params = self._get_sql_clause() |         select, sql, params = self._get_sql_clause() | ||||||
|         sql = 'SELECT %s %s GROUP BY 1 ORDER BY 1 %s' % \ |         sql = 'SELECT %s %s GROUP BY 1 ORDER BY 1 %s' % \ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user