Commit 10f7cfeb authored by wdmgsm's avatar wdmgsm Committed by Tim Graham
Browse files

Fixed #24520 -- Documented Widget.supports_microseconds

parent 783572ab
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -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``
~~~~~~~~~~~~