Loading docs/ref/forms/widgets.txt +17 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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`` ~~~~~~~~~~~~~ Loading @@ -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`` ~~~~~~~~~~~~ Loading Loading
docs/ref/forms/widgets.txt +17 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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`` ~~~~~~~~~~~~~ Loading @@ -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`` ~~~~~~~~~~~~ Loading