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
09a445b2
Commit
09a445b2
authored
Sep 26, 2012
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bits of cleanup
parent
728e92f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
16 deletions
+4
-16
rest_framework/parsers.py
+3
-16
rest_framework/settings.py
+1
-0
No files found.
rest_framework/parsers.py
View file @
09a445b2
...
@@ -34,8 +34,8 @@ class DataAndFiles(object):
...
@@ -34,8 +34,8 @@ class DataAndFiles(object):
class
BaseParser
(
object
):
class
BaseParser
(
object
):
"""
"""
All parsers should extend
:class:`BaseParser`, specifying a :attr:`media_type` attribute,
All parsers should extend
`BaseParser`, specifying a `media_type`
a
nd overriding the :meth:`parse
` method.
a
ttribute, and overriding the `.parse_stream()
` method.
"""
"""
media_type
=
None
media_type
=
None
...
@@ -66,7 +66,7 @@ class BaseParser(object):
...
@@ -66,7 +66,7 @@ class BaseParser(object):
def
parse_stream
(
self
,
stream
,
**
opts
):
def
parse_stream
(
self
,
stream
,
**
opts
):
"""
"""
Given a
*stream*
to read from, return the deserialized output.
Given a
stream
to read from, return the deserialized output.
Should return parsed data, or a DataAndFiles object consisting of the
Should return parsed data, or a DataAndFiles object consisting of the
parsed data and files.
parsed data and files.
"""
"""
...
@@ -234,16 +234,3 @@ class XMLParser(BaseParser):
...
@@ -234,16 +234,3 @@ class XMLParser(BaseParser):
pass
pass
return
value
return
value
DEFAULT_PARSERS
=
(
JSONParser
,
FormParser
,
MultiPartParser
,
XMLParser
)
if
yaml
:
DEFAULT_PARSERS
+=
(
YAMLParser
,
)
else
:
YAMLParser
=
None
rest_framework/settings.py
View file @
09a445b2
...
@@ -29,6 +29,7 @@ DEFAULTS = {
...
@@ -29,6 +29,7 @@ DEFAULTS = {
'DEFAULT_PARSERS'
:
(
'DEFAULT_PARSERS'
:
(
'rest_framework.parsers.JSONParser'
,
'rest_framework.parsers.JSONParser'
,
'rest_framework.parsers.FormParser'
'rest_framework.parsers.FormParser'
'rest_framework.parsers.MultiPartParser'
),
),
'DEFAULT_AUTHENTICATION'
:
(
'DEFAULT_AUTHENTICATION'
:
(
'rest_framework.authentication.SessionAuthentication'
,
'rest_framework.authentication.SessionAuthentication'
,
...
...
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