forms.FloatField

class FloatField(**kwargs) [source]

  • Default widget: NumberInput when Field.localize is False, else TextInput.
  • Empty value: None
  • Normalizes to: A Python float.
  • Validates that the given value is a float. Leading and trailing whitespace is allowed, as in Python’s float() function.
  • Error message keys: required, invalid, max_value, min_value

Takes two optional arguments for validation, max_value and min_value. These control the range of values permitted in the field.

doc_Django
2016-10-09 18:36:49
Comments
Leave a Comment

Please login to continue.