diff options
| author | wdmgsm <wdmgsm@yahoo.com> | 2015-03-22 13:27:01 +0000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-05-06 13:31:36 -0400 |
| commit | 10f7cfeb2df35c5f7775d59c9d654952971897fb (patch) | |
| tree | b26b4fc2eee6762efaaa565df5e3766a5e812535 /docs | |
| parent | 783572abc4cbbdf3272801d5d19ff8d7d5f2189d (diff) | |
Fixed #24520 -- Documented Widget.supports_microseconds
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/forms/widgets.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index 2260986ee1..bb0779f550 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -217,6 +217,17 @@ foundation for custom widgets. >>> name.render('name', 'A name') '<input name="name" type="text" value="A name" />' + .. attribute:: Widget.supports_microseconds + + An attribute that defaults to ``True``. If set to ``False``, the + microseconds part of :class:`~datetime.datetime` and + :class:`~datetime.time` values will be set to ``0``. + + .. versionadded:: 1.9 + + In older versions, this attribute was only defined on the date + and time widgets (as ``False``). + .. method:: render(name, value, attrs=None) Returns HTML for the widget, as a Unicode string. This method must be @@ -491,6 +502,10 @@ These widgets make use of the HTML elements ``input`` and ``textarea``. format found in :setting:`DATETIME_INPUT_FORMATS` and respects :ref:`format-localization`. + By default, the microseconds part of the time value is always set to ``0``. + If microseconds are required, use a subclass with the + :attr:`~Widget.supports_microseconds` attribute set to ``True``. + ``TimeInput`` ~~~~~~~~~~~~~ @@ -508,6 +523,8 @@ These widgets make use of the HTML elements ``input`` and ``textarea``. format found in :setting:`TIME_INPUT_FORMATS` and respects :ref:`format-localization`. + For the treatment of microseconds, see :class:`DateTimeInput`. + ``Textarea`` ~~~~~~~~~~~~ |
