magic-removal: Fixed #1301 -- Fixed AttributeError when QuerySet.dates() is filtered. Thanks, Esaj
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2223 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
77816bc850
commit
58bf60ec3d
|
@ -415,6 +415,11 @@ class ValuesQuerySet(QuerySet):
|
|||
for row in rows:
|
||||
yield dict(zip(field_names, row))
|
||||
|
||||
def _clone(self, klass=None, **kwargs):
|
||||
c = super(ValuesQuerySet, self)._clone(klass, **kwargs)
|
||||
c._fields = self._fields[:]
|
||||
return c
|
||||
|
||||
class DateQuerySet(QuerySet):
|
||||
def iterator(self):
|
||||
from django.db.backends.util import typecast_timestamp
|
||||
|
@ -433,6 +438,13 @@ class DateQuerySet(QuerySet):
|
|||
# objects -- MySQL returns the values as strings, instead.
|
||||
return [typecast_timestamp(str(row[0])) for row in cursor.fetchall()]
|
||||
|
||||
def _clone(self, klass=None, **kwargs):
|
||||
c = super(DateQuerySet, self)._clone(klass, **kwargs)
|
||||
c._field = self._field
|
||||
c._kind = self._kind
|
||||
c._order = self._order
|
||||
return c
|
||||
|
||||
class QOperator:
|
||||
"Base class for QAnd and QOr"
|
||||
def __init__(self, *args):
|
||||
|
|
Loading…
Reference in New Issue