mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-06-19 13:03:19 +03:00
Fix method overloading
This commit is contained in:
parent
b8559c6192
commit
071e7d72cd
|
@ -94,4 +94,4 @@ class MetadataMixin(object):
|
||||||
# for name, field in form.fields.iteritems():
|
# for name, field in form.fields.iteritems():
|
||||||
# field_name_types[name] = field.__class__.__name__
|
# field_name_types[name] = field.__class__.__name__
|
||||||
# content['fields'] = field_name_types
|
# content['fields'] = field_name_types
|
||||||
raise Response(content, status=status.HTTP_200_OK)
|
return Response(content, status=status.HTTP_200_OK)
|
||||||
|
|
|
@ -211,16 +211,18 @@ class Request(object):
|
||||||
# Method overloading - change the method and remove the param from the content.
|
# Method overloading - change the method and remove the param from the content.
|
||||||
if (self._METHOD_PARAM and
|
if (self._METHOD_PARAM and
|
||||||
self._METHOD_PARAM in self._data):
|
self._METHOD_PARAM in self._data):
|
||||||
# NOTE: `pop` on a `QueryDict` returns a list of values.
|
self._method = self._data[self._METHOD_PARAM].upper()
|
||||||
self._method = self._data.pop(self._METHOD_PARAM)[0].upper()
|
self._data.pop(self._METHOD_PARAM)
|
||||||
|
|
||||||
# Content overloading - modify the content type, and re-parse.
|
# Content overloading - modify the content type, and re-parse.
|
||||||
if (self._CONTENT_PARAM and
|
if (self._CONTENT_PARAM and
|
||||||
self._CONTENTTYPE_PARAM and
|
self._CONTENTTYPE_PARAM and
|
||||||
self._CONTENT_PARAM in self._data and
|
self._CONTENT_PARAM in self._data and
|
||||||
self._CONTENTTYPE_PARAM in self._data):
|
self._CONTENTTYPE_PARAM in self._data):
|
||||||
self._content_type = self._data.pop(self._CONTENTTYPE_PARAM)[0]
|
self._content_type = self._data[self._CONTENTTYPE_PARAM]
|
||||||
self._stream = StringIO(self._data.pop(self._CONTENT_PARAM)[0])
|
self._stream = StringIO(self._data[self._CONTENT_PARAM])
|
||||||
|
self._data.pop(self._CONTENTTYPE_PARAM)
|
||||||
|
self._data.pop(self._CONTENT_PARAM)
|
||||||
self._data, self._files = self._parse()
|
self._data, self._files = self._parse()
|
||||||
|
|
||||||
def _parse(self):
|
def _parse(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user