      except:
          return False
      return True
  
  # From piston
  def coerce_put_post(request):
      """
      Django doesn't particularly understand REST.
      In case we send data over PUT, Django won't
      actually look at the data and load it. We need
      to twist its arm here.
      
      The try/except abominiation here is due to a bug
      in mod_python. This should fix it.
      """
      if request.method != 'PUT':
          return
  
      # Bug fix: if _load_post_and_files has already been called, for
      # example by middleware accessing request.POST, the below code to
      # pretend the request is a POST instead of a PUT will be too late
      # to make a difference. Also calling _load_post_and_files will result 
      # in the following exception:
      #   AttributeError: You cannot set the upload handlers after the upload has been processed.
      # The fix is to check for the presence of the _post field which is set 
      # the first time _load_post_and_files is called (both by wsgi.py and 
      # modpython.py). If it's set, the request has to be 'reset' to redo
      # the query value parsing in POST mode.
      if hasattr(request, '_post'):
          del request._post
          del request._files
      
      try:
          request.method = "POST"
          request._load_post_and_files()
          request.method = "PUT"
      except AttributeError:
          request.META['REQUEST_METHOD'] = 'POST'
          request._load_post_and_files()
          request.META['REQUEST_METHOD'] = 'PUT'
          
      request.PUT = request.POST
  
  # From http://www.koders.com/python/fidB6E125C586A6F49EAC38992CF3AFDAAE35651975.aspx?s=mdef:xml
  #class object_dict(dict):
  #    """object view of dict, you can 
  #    >>> a = object_dict()
 
</s> remove         request = self.resource.request

        if request.method == 'PUT':
            data = parse_qs(input)
        elif request.method == 'POST':
            # Django has already done the form parsing for us.
            data = dict(request.POST.iterlists())
 </s> add         data = parse_qs(input) </s> remove         """If the request contains content return a tuple of (content_type, content) otherwise return None.
 </s> add         """If the request contains content, returns a tuple of (content_type, content) otherwise returns None. </s> remove         if request.method == 'PUT':
            upload_handlers = request._get_upload_handlers()
            django_mpp = DjangoMPParser(request.META, StringIO(input), upload_handlers)
            data, files = django_mpp.parse()
        elif request.method == 'POST':
            # Django has already done the form parsing for us.
            data = request.POST
            files = request.FILES
 </s> add         upload_handlers = request._get_upload_handlers()
        django_mpp = DjangoMPParser(request.META, StringIO(input), upload_handlers)
        data, files = django_mpp.parse() </s> remove     """The name to use for the content-type override field in the POST form."""
 </s> add     """The name to use for the content-type override field in the POST form. Taken into account only if content overloading is activated.""" </s> remove             # Set content type if form contains a none empty FORM_PARAM_CONTENTTYPE field
 </s> add             # Set content type if form contains a non-empty CONTENTTYPE_PARAM field
      except:
          return False
      return True
  






































  
  # From http://www.koders.com/python/fidB6E125C586A6F49EAC38992CF3AFDAAE35651975.aspx?s=mdef:xml
  #class object_dict(dict):
  #    """object view of dict, you can 
  #    >>> a = object_dict()
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 removed useless stuff, request.POST and FILES not used + some doc 
djangorestframework/utils.py