Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
071e7d72
Commit
071e7d72
authored
Sep 07, 2012
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix method overloading
parent
b8559c61
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
djangorestframework/mixins.py
+1
-1
djangorestframework/request.py
+6
-4
No files found.
djangorestframework/mixins.py
View file @
071e7d72
...
...
@@ -94,4 +94,4 @@ class MetadataMixin(object):
# for name, field in form.fields.iteritems():
# field_name_types[name] = field.__class__.__name__
# content['fields'] = field_name_types
r
aise
Response
(
content
,
status
=
status
.
HTTP_200_OK
)
r
eturn
Response
(
content
,
status
=
status
.
HTTP_200_OK
)
djangorestframework/request.py
View file @
071e7d72
...
...
@@ -211,16 +211,18 @@ class Request(object):
# Method overloading - change the method and remove the param from the content.
if
(
self
.
_METHOD_PARAM
and
self
.
_METHOD_PARAM
in
self
.
_data
):
# NOTE: `pop` on a `QueryDict` returns a list of values.
self
.
_
method
=
self
.
_data
.
pop
(
self
.
_METHOD_PARAM
)[
0
]
.
upper
(
)
self
.
_method
=
self
.
_data
[
self
.
_METHOD_PARAM
]
.
upper
()
self
.
_
data
.
pop
(
self
.
_METHOD_PARAM
)
# Content overloading - modify the content type, and re-parse.
if
(
self
.
_CONTENT_PARAM
and
self
.
_CONTENTTYPE_PARAM
and
self
.
_CONTENT_PARAM
in
self
.
_data
and
self
.
_CONTENTTYPE_PARAM
in
self
.
_data
):
self
.
_content_type
=
self
.
_data
.
pop
(
self
.
_CONTENTTYPE_PARAM
)[
0
]
self
.
_stream
=
StringIO
(
self
.
_data
.
pop
(
self
.
_CONTENT_PARAM
)[
0
])
self
.
_content_type
=
self
.
_data
[
self
.
_CONTENTTYPE_PARAM
]
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
()
def
_parse
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment