diff options
| author | Tom Christie | 2012-11-05 01:48:19 -0800 |
|---|---|---|
| committer | Tom Christie | 2012-11-05 01:48:19 -0800 |
| commit | 584c111aabc6d11db5d16d850036269c663a2403 (patch) | |
| tree | 9e0e66fd68bac1bce0fca88469b4b59f30003179 /rest_framework/response.py | |
| parent | 3e0319389a4e7714e0658bd38cb1e9fb01cf662d (diff) | |
| parent | 7df7dadccdba83d87fcc1ec6b5977fde26aab881 (diff) | |
| download | django-rest-framework-584c111aabc6d11db5d16d850036269c663a2403.tar.bz2 | |
Merge pull request #366 from jmagnusson/master
Support for Djangos caching framework, fixes #346
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 |
