diff options
| author | Ben Timby | 2012-01-18 22:59:30 -0500 |
|---|---|---|
| committer | Ben Timby | 2012-01-18 22:59:30 -0500 |
| commit | 0a5ca000edcd8fba1e5e5f71c7267d9f52e456a0 (patch) | |
| tree | b7ce62d60bc0aebc889a15cc6bd473d0a3ea8af1 /djangorestframework/parsers.py | |
| parent | 5f4096ca28d6c0b9ea98f43278789b38cf0d37bb (diff) | |
| download | django-rest-framework-0a5ca000edcd8fba1e5e5f71c7267d9f52e456a0.tar.bz2 | |
Docstring/whitespace fixes.
Diffstat (limited to 'djangorestframework/parsers.py')
| -rw-r--r-- | djangorestframework/parsers.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/djangorestframework/parsers.py b/djangorestframework/parsers.py index b99423a0..8fd1acbc 100644 --- a/djangorestframework/parsers.py +++ b/djangorestframework/parsers.py @@ -171,8 +171,8 @@ class MultiPartParser(BaseParser): raise ErrorResponse(status.HTTP_400_BAD_REQUEST, {'detail': 'multipart parse error - %s' % unicode(exc)}) return django_parser.parse() - - + + class XMLParser(BaseParser): """ XML parser. @@ -183,7 +183,7 @@ class XMLParser(BaseParser): def parse(self, stream): """ Returns a 2-tuple of `(data, files)`. - + `data` will simply be a string representing the body of the request. `files` will always be `None`. """ @@ -218,33 +218,33 @@ class XMLParser(BaseParser): """ Converts the value returned by the XMl parse into the equivalent Python type - """ - if value is None: + """ + if value is None: return value - + try: return datetime.datetime.strptime(value,'%Y-%m-%d %H:%M:%S') except ValueError: pass - + try: return int(value) except ValueError: pass - + try: return decimal.Decimal(value) except decimal.InvalidOperation: pass - + return value DEFAULT_PARSERS = ( JSONParser, FormParser, MultiPartParser, - XMLParser - ) + XMLParser + ) if YAMLParser: DEFAULT_PARSERS += ( YAMLParser, ) |
