diff options
| author | Ben Konrath | 2012-11-06 03:22:25 +0100 |
|---|---|---|
| committer | Ben Konrath | 2012-11-06 03:22:25 +0100 |
| commit | 09f39bd23b3c688c89551845d665395e1aabbfab (patch) | |
| tree | 67de86ddb90c4e91e66ee276252e9086064231da /rest_framework/response.py | |
| parent | 01564fb1e5727134d2ceb4b3ab79e013af1b4807 (diff) | |
| parent | 455a8cedcf5aa1f265ae95d4f3bff359d51910c0 (diff) | |
| download | django-rest-framework-09f39bd23b3c688c89551845d665395e1aabbfab.tar.bz2 | |
Merge branch 'master' into restframework2-filter
Diffstat (limited to 'rest_framework/response.py')
| -rw-r--r-- | rest_framework/response.py | 10 |
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 |
