                  else:
                      return parsed
  
          humanized_format = humanize_datetime.datetime_formats(self.input_formats)
          msg = self.error_messages['invalid'] % humanized_format
          raise ValidationError(msg)
  
      def to_representation(self, value):
          if value is None or self.format is None:
              return value
  
 
</s> remove         msg = self.error_messages['invalid'] % humanized_format
        raise ValidationError(msg)
 </s> add         self.fail('invalid', format=humanized_format) </s> remove         msg = self.error_messages['invalid'] % humanized_format
        raise ValidationError(msg)
 </s> add         self.fail('invalid', format=humanized_format) </s> remove     def get_url(self, obj, view_name, request, format):
        """
        Given an object, return the URL that hyperlinks to the object.

        May raise a `NoReverseMatch` if the `view_name` and `lookup_field`
        attributes are not configured to correctly match the URL conf.
        """
        # Unsaved objects will not yet have a valid URL.
        if obj.pk is None:
            return None

        lookup_value = getattr(obj, self.lookup_field)
        kwargs = {self.lookup_url_kwarg: lookup_value}
        return reverse(view_name, kwargs=kwargs, request=request, format=format)

 </s> add  </s> remove         if isinstance(self.queryset, QuerySet):
 </s> add         if isinstance(queryset, QuerySet):
        self.fail('invalid', format=humanized_format)
                  else:
                      return parsed
  
          humanized_format = humanize_datetime.datetime_formats(self.input_formats)
        self.fail('invalid', format=humanized_format)
        self.fail('invalid', format=humanized_format)
  
      def to_representation(self, value):
          if value is None or self.format is None:
              return value
  
keep keep keep keep replace replace keep keep keep keep keep
 Clean up relational fields queryset usage 
rest_framework/fields.py