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 ++++++ 1 file changed, 6 insertions(+) (limited to 'djangorestframework/parsers.py') 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,) -- cgit v1.2.3 From 20c7e605c987bbfec23fbd305e71168b21672bec Mon Sep 17 00:00:00 2001 From: Jens Alm Date: Sat, 2 Jul 2011 19:12:43 +0200 Subject: Sloppy copy-pasting... --- djangorestframework/parsers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'djangorestframework/parsers.py') diff --git a/djangorestframework/parsers.py b/djangorestframework/parsers.py index f4c8dcb4..168d391e 100644 --- a/djangorestframework/parsers.py +++ b/djangorestframework/parsers.py @@ -167,9 +167,9 @@ class MultiPartParser(BaseParser): {'detail': 'multipart parse error - %s' % unicode(exc)}) return django_parser.parse() -DEFAULT_PARSERS = ( parsers.JSONParser, - parsers.FormParser, - parsers.MultiPartParser ) +DEFAULT_PARSERS = ( JSONParser, + FormParser, + MultiPartParser ) if YAMLParser: DEFAULT_PARSERS += (YAMLParser,) -- cgit v1.2.3 From 3e0a978dd97a55a5db072584a2bba639ed790b82 Mon Sep 17 00:00:00 2001 From: Jens Alm Date: Sat, 2 Jul 2011 19:19:45 +0200 Subject: Fixed YAMLParser = None --- djangorestframework/parsers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'djangorestframework/parsers.py') diff --git a/djangorestframework/parsers.py b/djangorestframework/parsers.py index 168d391e..41f15aa3 100644 --- a/djangorestframework/parsers.py +++ b/djangorestframework/parsers.py @@ -108,7 +108,8 @@ if yaml: except ValueError, exc: raise ErrorResponse(status.HTTP_400_BAD_REQUEST, {'detail': 'YAML parse error - %s' % unicode(exc)}) - +else: + YAMLParser = None class PlainTextParser(BaseParser): """ -- cgit v1.2.3