TimeField
class
TimeField
A field that converts its input to a datetime.time without timezone.
TimeField(
*,
required: bool = True,
default: Any = None,
after_time: datetime.time | str | None = None,
before_time: datetime.time | str | None = None,
past_time: bool = False,
future_time: bool = False,
offset: int | float = 0,
one_of: collections.abc.Iterable[typing.Any] | None = None,
messages: dict[str, str] | None = None,
_utcnow: datetime.datetime | None = None
)
Bases: Field
| 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 |
after_time |
A time that the field value must be after. Defaults to |
before_time |
A time that the field value must be before. Defaults to |
future_time |
Whether the time must be in the future. Defaults to |
offset |
Timezone offset in hours (floats are allowed) for calculating "now" when
|
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"}. |