diff options
| author | GitHub Merge Button | 2011-07-02 10:16:47 -0700 |
|---|---|---|
| committer | GitHub Merge Button | 2011-07-02 10:16:47 -0700 |
| commit | f168ac99382512bd915bbfb7d119a9f8ec7eb429 (patch) | |
| tree | cc4b931316fa76fe5dfc75ee66c315e2b29089db | |
| parent | 1885012d61c7ba78e78648ef2bff89e4337c0407 (diff) | |
| parent | 20c7e605c987bbfec23fbd305e71168b21672bec (diff) | |
| download | django-rest-framework-f168ac99382512bd915bbfb7d119a9f8ec7eb429.tar.bz2 | |
Merge 20c7e605c987bbfec23fbd305e71168b21672bec into 1885012d61c7ba78e78648ef2bff89e4337c0407
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | djangorestframework/parsers.py | 6 | ||||
| -rw-r--r-- | djangorestframework/views.py | 4 |
3 files changed, 8 insertions, 3 deletions
@@ -21,3 +21,4 @@ MANIFEST .coverage .tox .DS_Store +.idea/*
\ No newline at end of file diff --git a/djangorestframework/parsers.py b/djangorestframework/parsers.py index 5f19c521..168d391e 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,) 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. |
