FloatField
class
FloatField
A field that converts its input to a float.
FloatField(
*,
required: bool = True,
default: Any = None,
gt: int | float | None = None,
gte: int | float | None = None,
lt: int | float | None = None,
lte: int | float | None = None,
multiple_of: int | float | None = None,
one_of: collections.abc.Iterable[typing.Any] | None = None,
messages: dict[str, str] | None = None
)
Bases: NumberField
| Argument | Description |
|---|---|
required |
Whether the field is required. Defaults to |
default |
Default value for the field. Can be a static value or a callable.
Defaults to |
gt |
Value must be greater than this. Defaults to |
gte |
Value must be greater than or equal to this. Defaults to |
lt |
Value must be less than this. Defaults to |
lte |
Value must be less than or equal to this. Defaults to |
multiple_of |
Value must be a multiple of this. Defaults to |
one_of |
List of values that the field value must be one of. Defaults to |
messages |
Dictionary of error codes to custom error message templates. These override the default error messages for this specific field. Example: {"required": "This field cannot be empty"}. |