diff options
| -rw-r--r-- | .gitignore | 14 | ||||
| -rw-r--r-- | djangorestframework/parsers.py | 6 | ||||
| -rw-r--r-- | djangorestframework/views.py | 8 |
3 files changed, 23 insertions, 5 deletions
@@ -21,3 +21,17 @@ MANIFEST .coverage .tox .DS_Store + +.idea/workspace.xml + +.idea/vcs.xml + +.idea/modules.xml + +.idea/misc.xml + +.idea/encodings.xml + +.idea/django-rest-framework.iml + +.idea/.name
\ No newline at end of file diff --git a/djangorestframework/parsers.py b/djangorestframework/parsers.py index 5f19c521..cfe8ec9e 100644 --- a/djangorestframework/parsers.py +++ b/djangorestframework/parsers.py @@ -167,3 +167,9 @@ class MultiPartParser(BaseParser): {'detail': 'multipart parse error - %s' % unicode(exc)}) return django_parser.parse() +DEFAULT_PARSERS = ( JSONParser, + FormParser, + MultiPartParser ) + +if YAMLParser: + DEFAULT_PARSERS += (YAMLParser,)
\ No newline at end of file diff --git a/djangorestframework/views.py b/djangorestframework/views.py index eea3b97a..aedc7427 100644 --- a/djangorestframework/views.py +++ b/djangorestframework/views.py @@ -40,14 +40,12 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView): """ List of renderers the resource can serialize the response with, ordered by preference. """ - renderers = renderers.DEFAULT_RENDERERS + renderers = renderers.DEFAULT_RENDERERS + """ List of parsers the resource can parse the request with. """ - parsers = ( parsers.JSONParser, - parsers.FormParser, - parsers.MultiPartParser ) - + parsers = parsers.DEFAULT_PARSERS """ List of all authenticating methods to attempt. """ |
