1. Tom Christie
  2. Django REST Framework

Commits

Jens Alm  committed 28fb439

parsers.DEFAULT_PARSERS added to be consistent with renderers.DEFAULT_RENDERERS

  • Participants
  • Parent commits 48ae2d2
  • Branches default

Comments (0)

Files changed (3)

File .gitignore

View file
  • Ignore whitespace
 .coverage
 .tox
 .DS_Store
+.idea/*

File djangorestframework/parsers.py

View file
  • Ignore whitespace
                                 {'detail': 'multipart parse error - %s' % unicode(exc)})
         return django_parser.parse()
 
+DEFAULT_PARSERS = ( parsers.JSONParser,
+                    parsers.FormParser,
+                    parsers.MultiPartParser )
+
+if YAMLParser:
+    DEFAULT_PARSERS += (YAMLParser,)

File djangorestframework/views.py

View file
  • Ignore whitespace
     """
     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.