From 9d8bce8f5b0915223f57d9fe3d4b63029cfc64c2 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 5 Oct 2012 14:48:33 +0100 Subject: Remove Parser.can_handle_request() --- rest_framework/parsers.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'rest_framework/parsers.py') 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 -- cgit v1.2.3