Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #10547 -- Worked around some odd behaviour in Python 2.3 and 2.4.

Calling the super() version of __reduce__ in Model.__reduce__ led to infinite
loops in Python prior to 2.5. We don't do that any longer.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10099 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 255cb391d16238d07ca530e3e2d41c897858231d 1 parent e3139cc
@malcolmt malcolmt authored
View
4 django/db/models/base.py
@@ -348,9 +348,9 @@ def __reduce__(self):
need to do things manually, as they're dynamically created classes and
only module-level classes can be pickled by the default path.
"""
- if not self._deferred:
- return super(Model, self).__reduce__()
data = self.__dict__
+ if not self._deferred:
+ return (self.__class__, (), data)
defers = []
pk_val = None
for field in self._meta.fields:
View
3  tests/regressiontests/queries/models.py
@@ -895,6 +895,9 @@ def __unicode__(self):
>>> q2 = pickle.loads(pickle.dumps(qs))
>>> list(qs) == list(q2)
True
+>>> q3 = pickle.loads(pickle.dumps(qs, pickle.HIGHEST_PROTOCOL))
+>>> list(qs) == list(q3)
+True
Bug #7277
>>> n1.annotation_set.filter(Q(tag=t5) | Q(tag__children=t5) | Q(tag__children__children=t5))
Please sign in to comment.
Something went wrong with that request. Please try again.