          return '{0:f}'.format(quantized)
  
  
  # Date & time fields...
  
  class DateTimeField(Field):
      default_error_messages = {
 
</s> remove         context = decimal.getcontext().copy()
        context.prec = self.max_digits
        quantized = value.quantize(
            decimal.Decimal('.1') ** self.decimal_places,
            context=context
        )
 </s> add         quantized = self.quantize(value)
 </s> remove         Validates that the input is a decimal number. Returns a Decimal
        instance. Returns None for empty values. Ensures that there are no more
        than max_digits in the number, and no more than decimal_places digits
        after the decimal point.
 </s> add         Validate that the input is a decimal number and return a Decimal
        instance.
    def quantize(self, value):
        """
        Quantize the decimal value to the configured precision.
        """
        context = decimal.getcontext().copy()
        context.prec = self.max_digits
        return value.quantize(
            decimal.Decimal('.1') ** self.decimal_places,
            context=context)

          return '{0:f}'.format(quantized)
  
    def quantize(self, value):
        """
        Quantize the decimal value to the configured precision.
        """
        context = decimal.getcontext().copy()
        context.prec = self.max_digits
        return value.quantize(
            decimal.Decimal('.1') ** self.decimal_places,
            context=context)

  
  # Date & time fields...
  
  class DateTimeField(Field):
      default_error_messages = {
keep add keep keep keep keep keep
 Refactored DecimalField to allow easier subclassing 
rest_framework/fields.py