      class Meta:
          model = CharPrimaryKeyModel
  
  
  class DateObjectSerializer(serializers.Serializer):
      date = serializers.DateField()
  
      def restore_object(self, attrs, instance=None):
          if instance is not None:
              instance.date = attrs['date']
              return instance
          return DateObject(**attrs)
  
  
  class DateObjectCustomFormatSerializer(serializers.Serializer):
      date = serializers.DateField(format=("%Y", "%Y -- %m"))
  
      def restore_object(self, attrs, instance=None):
          if instance is not None:
              instance.date = attrs['date']
              return instance
          return DateObject(**attrs)
  
  
  class DateTimeObjectSerializer(serializers.Serializer):
      date_time = serializers.DateTimeField()
  
      def restore_object(self, attrs, instance=None):
          if instance is not None:
              instance.date_time = attrs['date_time']
              return instance
          return DateTimeObject(**attrs)
  
  
  class DateTimeObjectCustomFormatSerializer(serializers.Serializer):
      date_time = serializers.DateTimeField(format=("%Y", "%Y %H:%M"))
  
      def restore_object(self, attrs, instance=None):
          if instance is not None:
              instance.date_time = attrs['date_time']
              return instance
          return DateTimeObject(**attrs)
  
  
  class TimeObjectSerializer(serializers.Serializer):
      time = serializers.TimeField()
  
      def restore_object(self, attrs, instance=None):
          if instance is not None:
              instance.time = attrs['time']
              return instance
          return TimeObject(**attrs)
  
  
  class TimeObjectCustomFormatSerializer(serializers.Serializer):
      time = serializers.TimeField(format=("%H -- %M", "%H%M%S"))
  
      def restore_object(self, attrs, instance=None):
          if instance is not None:
              instance.time = attrs['time']
              return instance
          return TimeObject(**attrs)
  
  
  class TimeFieldModel(models.Model):
      clock = models.TimeField()
  
  
  class TimeFieldModelSerializer(serializers.ModelSerializer):
 
</s> remove class DateObject(object):
    def __init__(self, date):
        self.date = date


class DateTimeObject(object):
    def __init__(self, date_time):
        self.date_time = date_time


class TimeObject(object):
    def __init__(self, time):
        self.time = time


 </s> add  </s> remove         self.format = kwargs.pop('format', settings.DATE_INPUT_FORMATS)
 </s> add         self.input_formats = kwargs.pop('input_formats', api_settings.DATE_INPUT_FORMATS)
        self.output_format = kwargs.pop('output_format', api_settings.DATE_OUTPUT_FORMAT)
      class Meta:
          model = CharPrimaryKeyModel
  
  




























































  class TimeFieldModel(models.Model):
      clock = models.TimeField()
  
  
  class TimeFieldModelSerializer(serializers.ModelSerializer):
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 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
 Add drf settings + output format + testcases 
rest_framework/tests/fields.py