Ticket #3440: date__queryset.patch
File date__queryset.patch, 1.2 KB (added by , 17 years ago) |
---|
-
django/db/models/query.py
665 665 666 666 has_resolve_columns = hasattr(self, 'resolve_columns') 667 667 needs_datetime_string_cast = connection.features.needs_datetime_string_cast 668 dates = []669 668 # It would be better to use self._field here instead of DateTimeField(), 670 669 # but in Oracle that will result in a list of datetime.date instead of 671 670 # datetime.datetime. … … 673 672 while 1: 674 673 rows = cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE) 675 674 if not rows: 676 r eturn dates675 raise StopIteration 677 676 for row in rows: 678 677 date = row[0] 679 678 if has_resolve_columns: 680 679 date = self.resolve_columns([date], fields)[0] 681 680 elif needs_datetime_string_cast: 682 681 date = typecast_timestamp(str(date)) 683 dates.append(date)682 yield date 684 683 685 684 def _clone(self, klass=None, **kwargs): 686 685 c = super(DateQuerySet, self)._clone(klass, **kwargs)