aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/utils/serializer_helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'rest_framework/utils/serializer_helpers.py')
-rw-r--r--rest_framework/utils/serializer_helpers.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/rest_framework/utils/serializer_helpers.py b/rest_framework/utils/serializer_helpers.py
index ab057862..87bb3ac0 100644
--- a/rest_framework/utils/serializer_helpers.py
+++ b/rest_framework/utils/serializer_helpers.py
@@ -19,6 +19,11 @@ class ReturnDict(OrderedDict):
def __repr__(self):
return dict.__repr__(self)
+ def __reduce__(self):
+ # Pickling these objects will drop the .serializer backlink,
+ # but preserve the raw data.
+ return (dict, (dict(self),))
+
class ReturnList(list):
"""
@@ -33,6 +38,11 @@ class ReturnList(list):
def __repr__(self):
return list.__repr__(self)
+ def __reduce__(self):
+ # Pickling these objects will drop the .serializer backlink,
+ # but preserve the raw data.
+ return (list, (list(self),))
+
class BoundField(object):
"""