From f73588eb425f611cb79c7a56133690328739bf6c Mon Sep 17 00:00:00 2001 From: Jens Alm Date: Sat, 2 Jul 2011 19:03:26 +0200 Subject: parsers.DEFAULT_PARSERS added to be consistent with renderers.DEFAULT_RENDERERS --- djangorestframework/parsers.py | 6 ++++++ djangorestframework/views.py | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'djangorestframework') diff --git a/djangorestframework/parsers.py b/djangorestframework/parsers.py index 5f19c521..f4c8dcb4 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 = ( parsers.JSONParser, + parsers.FormParser, + parsers.MultiPartParser ) + +if YAMLParser: + DEFAULT_PARSERS += (YAMLParser,) diff --git a/djangorestframework/views.py b/djangorestframework/views.py index eea3b97a..c25bb88f 100644 --- a/djangorestframework/views.py +++ b/djangorestframework/views.py @@ -44,9 +44,7 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView): """ 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. -- cgit v1.2.3