Fixed #24520 -- Documented Widget.supports_microseconds

This commit is contained in:
wdmgsm 2015-03-22 13:27:01 +00:00 committed by Tim Graham
parent 783572abc4
commit 10f7cfeb2d
1 changed files with 17 additions and 0 deletions

View File

@ -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``
~~~~~~~~~~~~