                  data.pop(key)
          return data
  
  # TODO: Allow parsers to specify multiple media_types
  class MultipartParser(FormParser):
      media_type = 'multipart/form-data'
  
      def parse(self, input):
          request = self.resource.request
  
 
</s> remove     # TODO: not good, because posted/put lists are flattened !!!
 </s> add     # TODO: writing tests for PUT files + normal data </s> remove 
class FormParser(BaseParser):
 </s> add class DataFlatener(object):

    def flatten_data(self, data):
        """Given a data dictionary ``{<attr_name>: <value_list>}``, returns a flattened dictionary according to :meth:`FormParser.is_a_list`.
        """
        #TODO : document + test
        flatdata = dict()
        for attr_name, attr_value in data.items():
            if self.is_a_list(attr_name):
                if isinstance(attr_value, list):
                    flatdata[attr_name] = attr_value
                else:
                    flatdata[attr_name] = [attr_value]
            else:
                if isinstance(attr_value, list):
                    flatdata[attr_name] = attr_value[0]
                else:
                    flatdata[attr_name] = attr_value 
        return flatdata

    def is_a_list(self, attr_name):
        """ """
        #TODO: document
        return False

class FormParser(BaseParser, DataFlatener): </s> remove             # Flattening the parsed query data
            for key, val in data.items():
                data[key] = val[0]
 </s> add  </s> remove             data = dict(request.POST.items())
 </s> add             data = request.POST

        data = self.flatten_data(data) </s> remove             returned = (content_type, f.read())
            return returned
            #try:
            #    f.close()
            #except Exception as e:
            #    print 'exception', e
 </s> add             return (content_type, f.read())
class MultipartParser(BaseParser, DataFlatener):
                  data.pop(key)
          return data
  
  # TODO: Allow parsers to specify multiple media_types
class MultipartParser(BaseParser, DataFlatener):
      media_type = 'multipart/form-data'
  
      def parse(self, input):
          request = self.resource.request
  
keep keep keep keep replace keep keep keep keep keep
 forms and multipat parsers now flaten data 
djangorestframework/parsers.py