diff options
Diffstat (limited to 'docs/ref/forms')
| -rw-r--r-- | docs/ref/forms/fields.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index 0f13adc249..b63826d9b1 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -546,6 +546,23 @@ For each field, we describe the default widget used if you don't specify The maximum number of decimal places permitted. +``DurationField`` +~~~~~~~~~~~~~~~~~ + +.. versionadded:: 1.8 + +.. class:: DurationField(**kwargs) + + * Default widget: :class:`TextInput` + * Empty value: ``None`` + * Normalizes to: A Python :class:`~python:datetime.timedelta`. + * Validates that the given value is a string which can be converted into a + ``timedelta``. + * Error message keys: ``required``, ``invalid``. + + Accepts any format understood by + :func:`~django.utils.dateparse.parse_duration`. + ``EmailField`` ~~~~~~~~~~~~~~ |
