diff options
| author | sebpiq | 2011-03-10 16:49:11 +0200 |
|---|---|---|
| committer | sebpiq | 2011-03-10 16:49:11 +0200 |
| commit | 2d8e4e056b1b6f822d02d614955ee1f220e2fdda (patch) | |
| tree | e96ef74ad806bcdb76186253bd093aaa284003e5 /djangorestframework/content.py | |
| parent | 26e10d0e3fadf1ff87da1650e30c1de34392b0d4 (diff) | |
| download | django-rest-framework-2d8e4e056b1b6f822d02d614955ee1f220e2fdda.tar.bz2 | |
documentation
Diffstat (limited to 'djangorestframework/content.py')
| -rw-r--r-- | djangorestframework/content.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/djangorestframework/content.py b/djangorestframework/content.py index 96050029..48f327b6 100644 --- a/djangorestframework/content.py +++ b/djangorestframework/content.py @@ -28,10 +28,12 @@ class StandardContentMixin(ContentMixin): class OverloadedContentMixin(ContentMixin): """HTTP request content behaviour that also allows arbitrary content to be tunneled in form data.""" - """The name to use for the content override field in the POST form. Set this to *None* to desactivate content overloading.""" + """The name to use for the content override field in the POST form. + Set this to *None* to desactivate content overloading.""" CONTENT_PARAM = '_content' - """The name to use for the content-type override field in the POST form. Taken into account only if content overloading is activated.""" + """The name to use for the content-type override field in the POST form. + Taken into account only if content overloading is activated.""" CONTENTTYPE_PARAM = '_contenttype' def determine_content(self, request): @@ -48,6 +50,7 @@ class OverloadedContentMixin(ContentMixin): content_type = None if self.CONTENTTYPE_PARAM and request.POST.get(self.CONTENTTYPE_PARAM, None): content_type = request.POST.get(self.CONTENTTYPE_PARAM, None) + request.META['CONTENT_TYPE'] = content_type return (content_type, request.POST[self.CONTENT_PARAM]) else: |
