diff options
| author | Tom Christie | 2012-10-05 14:48:33 +0100 | 
|---|---|---|
| committer | Tom Christie | 2012-10-05 14:48:33 +0100 | 
| commit | 9d8bce8f5b0915223f57d9fe3d4b63029cfc64c2 (patch) | |
| tree | a0a3f9e5a80335dcba3315f81b498e3aed241dcb /rest_framework/parsers.py | |
| parent | 3e862c77379b2f84356e2e8f0be20b7aca5b9e89 (diff) | |
| download | django-rest-framework-9d8bce8f5b0915223f57d9fe3d4b63029cfc64c2.tar.bz2 | |
Remove Parser.can_handle_request()
Diffstat (limited to 'rest_framework/parsers.py')
| -rw-r--r-- | rest_framework/parsers.py | 17 | 
1 files changed, 1 insertions, 16 deletions
| diff --git a/rest_framework/parsers.py b/rest_framework/parsers.py index 5151b252..5325a64b 100644 --- a/rest_framework/parsers.py +++ b/rest_framework/parsers.py @@ -15,11 +15,9 @@ from django.http import QueryDict  from django.http.multipartparser import MultiPartParser as DjangoMultiPartParser  from django.http.multipartparser import MultiPartParserError  from django.utils import simplejson as json -from rest_framework.compat import yaml +from rest_framework.compat import yaml, ETParseError  from rest_framework.exceptions import ParseError -from rest_framework.utils.mediatypes import media_type_matches  from xml.etree import ElementTree as ET -from rest_framework.compat import ETParseError  from xml.parsers.expat import ExpatError  import datetime  import decimal @@ -40,19 +38,6 @@ class BaseParser(object):      media_type = None -    def can_handle_request(self, content_type): -        """ -        Returns :const:`True` if this parser is able to deal with the given *content_type*. - -        The default implementation for this function is to check the *content_type* -        argument against the :attr:`media_type` attribute set on the class to see if -        they match. - -        This may be overridden to provide for other behavior, but typically you'll -        instead want to just set the :attr:`media_type` attribute on the class. -        """ -        return media_type_matches(self.media_type, content_type) -      def parse(self, string_or_stream, **opts):          """          The main entry point to parsers.  This is a light wrapper around | 
