diff options
| author | tom christie tom@tomchristie.com | 2011-01-26 21:06:40 +0000 |
|---|---|---|
| committer | tom christie tom@tomchristie.com | 2011-01-26 21:06:40 +0000 |
| commit | 9adb965126366bfe4b364357f565baabd819c982 (patch) | |
| tree | f924a64d0c4c8ff023f92fd9ef035060c825f647 /flywheel/parsers.py | |
| parent | 6807cf014cb0fde611f63c64bc352038206176cc (diff) | |
| parent | 8b89d7416cf4e2396deac4ba41c23cdcdc8b9704 (diff) | |
| download | django-rest-framework-9adb965126366bfe4b364357f565baabd819c982.tar.bz2 | |
content type tunneling
Diffstat (limited to 'flywheel/parsers.py')
| -rw-r--r-- | flywheel/parsers.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/flywheel/parsers.py b/flywheel/parsers.py index 57218cc6..98232a96 100644 --- a/flywheel/parsers.py +++ b/flywheel/parsers.py @@ -11,7 +11,7 @@ class BaseParser(object): """All parsers should extend BaseParser, specifing a media_type attribute, and overriding the parse() method.""" - media_types = () + media_type = None def __init__(self, resource): """Initialise the parser with the Resource instance as state, @@ -26,7 +26,7 @@ class BaseParser(object): class JSONParser(BaseParser): - media_types = ('application/xml',) + media_type = 'application/json' def parse(self, input): try: @@ -36,7 +36,7 @@ class JSONParser(BaseParser): class XMLParser(BaseParser): - media_types = ('application/xml',) + media_type = 'application/xml' class FormParser(BaseParser): @@ -44,7 +44,7 @@ class FormParser(BaseParser): Return a dict containing a single value for each non-reserved parameter. """ - media_types = ('application/x-www-form-urlencoded',) + media_type = 'application/x-www-form-urlencoded' def parse(self, input): # The FormParser doesn't parse the input as other parsers would, since Django's already done the |
