          return value
  
      def to_representation(self, value):
          if not isinstance(value, decimal.Decimal):
              value = decimal.Decimal(str(value).strip())
  
          context = decimal.getcontext().copy()
          context.prec = self.max_digits
          quantized = value.quantize(
              decimal.Decimal('.1') ** self.decimal_places,
 
</s> remove         return str(value).strip()
 </s> add         return six.text_type(value).strip() </s> remove             return self.represent_scalar('tag:yaml.org,2002:str', str(data))
 </s> add             return self.represent_scalar('tag:yaml.org,2002:str', six.text_type(data)) </s> remove         orm_lookups = [self.construct_search(str(search_field))
 </s> add         orm_lookups = [self.construct_search(six.text_type(search_field)) </s> remove             self.choice_strings_to_values[str(item)] for item in value
 </s> add             self.choice_strings_to_values[six.text_type(item)] for item in value </s> remove             return str(obj.total_seconds())
 </s> add             return six.text_type(obj.total_seconds())
            value = decimal.Decimal(six.text_type(value).strip())
          return value
  
      def to_representation(self, value):
          if not isinstance(value, decimal.Decimal):
            value = decimal.Decimal(six.text_type(value).strip())
  
          context = decimal.getcontext().copy()
          context.prec = self.max_digits
          quantized = value.quantize(
              decimal.Decimal('.1') ** self.decimal_places,
keep keep keep keep replace keep keep keep keep keep
 Use six.text_type instead of str everywhere 
rest_framework/fields.py