Commit 24a45a5f authored by Timo Graham's avatar Timo Graham
Browse files

Fixed #16602 - Added forms.widgets TOC links to docs; thanks kencochrane.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16633 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent ec530b14
Loading
Loading
Loading
Loading
+61 −0
Original line number Diff line number Diff line
@@ -171,6 +171,9 @@ Built-in widgets
Django provides a representation of all the basic HTML widgets, plus some
commonly used groups of widgets:

``Widget``
~~~~~~~~~~

.. class:: Widget

    This abstract class cannot be rendered, but provides the basic attribute :attr:`~Widget.attrs`.
@@ -185,11 +188,16 @@ commonly used groups of widgets:
            >>> name.render('name', 'A name')
            u'<input title="Your name" type="text" name="name" value="A name" size="10" />'

``TextInput``
~~~~~~~~~~~~~

.. class:: TextInput

    Text input: ``<input type='text' ...>``

``PasswordInput``
~~~~~~~~~~~~~~~~~

.. class:: PasswordInput

    Password input: ``<input type='password' ...>``
@@ -206,10 +214,16 @@ commonly used groups of widgets:
            :attr:`~PasswordInput.render_value` was
            changed from ``True`` to ``False``

``HiddenInput``
~~~~~~~~~~~~~~~

.. class:: HiddenInput

    Hidden input: ``<input type='hidden' ...>``

``MultipleHiddenInput``
~~~~~~~~~~~~~~~~~~~~~~~

.. class:: MultipleHiddenInput

    Multiple ``<input type='hidden' ...>`` widgets.
@@ -223,10 +237,16 @@ commonly used groups of widgets:
        :attr:`~Field.choices` attribute. If it does, it will override anything
        you set here when the attribute is updated on the :class:`Field`.

``FileInput``
~~~~~~~~~~~~~

.. class:: FileInput

    File upload input: ``<input type='file' ...>``

``ClearableFileInput``
~~~~~~~~~~~~~~~~~~~~~~

.. class:: ClearableFileInput

    .. versionadded:: 1.3
@@ -235,6 +255,9 @@ commonly used groups of widgets:
    input to clear the field's value, if the field is not required and has
    initial data.

``DateInput``
~~~~~~~~~~~~~

.. class:: DateInput

    Date input as a simple text box: ``<input type='text' ...>``
@@ -249,6 +272,9 @@ commonly used groups of widgets:
    format found in :setting:`DATE_INPUT_FORMATS` and respects
    :ref:`format-localization`.

``DateTimeInput``
~~~~~~~~~~~~~~~~~

.. class:: DateTimeInput

    Date/time input as a simple text box: ``<input type='text' ...>``
@@ -263,6 +289,9 @@ commonly used groups of widgets:
    format found in :setting:`DATETIME_INPUT_FORMATS` and respects
    :ref:`format-localization`.

``TimeInput``
~~~~~~~~~~~~~

.. class:: TimeInput

    Time input as a simple text box: ``<input type='text' ...>``
@@ -277,10 +306,16 @@ commonly used groups of widgets:
    format found in :setting:`TIME_INPUT_FORMATS` and respects
    :ref:`format-localization`.

``Textarea``
~~~~~~~~~~~~

.. class:: Textarea

    Text area: ``<textarea>...</textarea>``

``CheckboxInput``
~~~~~~~~~~~~~~~~~

.. class:: CheckboxInput

    Checkbox: ``<input type='checkbox' ...>``
@@ -292,6 +327,9 @@ commonly used groups of widgets:
        A callable that takes the value of the CheckBoxInput and returns
        ``True`` if the checkbox should be checked for that value.

``Select``
~~~~~~~~~~

.. class:: Select

    Select widget: ``<select><option ...>...</select>``
@@ -302,15 +340,24 @@ commonly used groups of widgets:
        :attr:`~Field.choices` attribute. If it does, it will override anything
        you set here when the attribute is updated on the :class:`Field`.

``NullBooleanSelect``
~~~~~~~~~~~~~~~~~~~~~

.. class:: NullBooleanSelect

    Select widget with options 'Unknown', 'Yes' and 'No'

``SelectMultiple``
~~~~~~~~~~~~~~~~~~

.. class:: SelectMultiple

    Similar to :class:`Select`, but allows multiple selection:
    ``<select multiple='multiple'>...</select>``

``RadioSelect``
~~~~~~~~~~~~~~~

.. class:: RadioSelect

    Similar to :class:`Select`, but rendered as a list of radio buttons:
@@ -322,6 +369,9 @@ commonly used groups of widgets:
          ...
        </ul>

``CheckboxSelectMultiple``
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. class:: CheckboxSelectMultiple

    Similar to :class:`SelectMultiple`, but rendered as a list of check
@@ -334,6 +384,9 @@ commonly used groups of widgets:
          ...
        </ul>

``MultiWidget``
~~~~~~~~~~~~~~~

.. class:: MultiWidget

    Wrapper around multiple other widgets. You'll probably want to use this
@@ -381,6 +434,9 @@ commonly used groups of widgets:

        An iterable containing the widgets needed.

``SplitDateTimeWidget``
~~~~~~~~~~~~~~~~~~~~~~~

.. class:: SplitDateTimeWidget

    Wrapper (using :class:`MultiWidget`) around two widgets: :class:`DateInput`
@@ -396,6 +452,8 @@ commonly used groups of widgets:

        Similar to :attr:`TimeInput.format`

``SplitHiddenDateTimeWidget``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. class:: SplitHiddenDateTimeWidget

@@ -404,6 +462,9 @@ commonly used groups of widgets:

.. currentmodule:: django.forms.extras.widgets

``SelectDateWidget``
~~~~~~~~~~~~~~~~~~~~

.. class:: SelectDateWidget

    Wrapper around three :class:`~django.forms.Select` widgets: one each for