aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/response.py
diff options
context:
space:
mode:
authorStephan Groß2012-11-05 11:45:49 +0100
committerStephan Groß2012-11-05 11:45:49 +0100
commit44449fa1f5f2d68740c9fb6a13c8e0a0eb41434c (patch)
treec4b6d8ed8af239dd5651d9f6a18ddbfe2079bc07 /rest_framework/response.py
parentff7725f05e8ca624e54d707f7c655e3d5c8b8888 (diff)
parent5b397e50ddb999f85949a7359d0a26c3531c78a9 (diff)
downloaddjango-rest-framework-44449fa1f5f2d68740c9fb6a13c8e0a0eb41434c.tar.bz2
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'rest_framework/response.py')
-rw-r--r--rest_framework/response.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/rest_framework/response.py b/rest_framework/response.py
index 7a459c8f..006d7eeb 100644
--- a/rest_framework/response.py
+++ b/rest_framework/response.py
@@ -45,3 +45,13 @@ class Response(SimpleTemplateResponse):
# TODO: Deprecate and use a template tag instead
# TODO: Status code text for RFC 6585 status codes
return STATUS_CODE_TEXT.get(self.status_code, '')
+
+ def __getstate__(self):
+ """
+ Remove attributes from the response that shouldn't be cached
+ """
+ state = super(Response, self).__getstate__()
+ for key in ('accepted_renderer', 'renderer_context', 'data'):
+ if key in state:
+ del state[key]
+ return state