Loading docs/ref/forms/widgets.txt +61 −0 Original line number Diff line number Diff line Loading @@ -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`. Loading @@ -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' ...>`` Loading @@ -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. Loading @@ -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 Loading @@ -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' ...>`` Loading @@ -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' ...>`` Loading @@ -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' ...>`` Loading @@ -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' ...>`` Loading @@ -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>`` Loading @@ -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: Loading @@ -322,6 +369,9 @@ commonly used groups of widgets: ... </ul> ``CheckboxSelectMultiple`` ~~~~~~~~~~~~~~~~~~~~~~~~~~ .. class:: CheckboxSelectMultiple Similar to :class:`SelectMultiple`, but rendered as a list of check Loading @@ -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 Loading Loading @@ -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` Loading @@ -396,6 +452,8 @@ commonly used groups of widgets: Similar to :attr:`TimeInput.format` ``SplitHiddenDateTimeWidget`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. class:: SplitHiddenDateTimeWidget Loading @@ -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 Loading Loading
docs/ref/forms/widgets.txt +61 −0 Original line number Diff line number Diff line Loading @@ -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`. Loading @@ -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' ...>`` Loading @@ -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. Loading @@ -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 Loading @@ -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' ...>`` Loading @@ -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' ...>`` Loading @@ -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' ...>`` Loading @@ -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' ...>`` Loading @@ -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>`` Loading @@ -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: Loading @@ -322,6 +369,9 @@ commonly used groups of widgets: ... </ul> ``CheckboxSelectMultiple`` ~~~~~~~~~~~~~~~~~~~~~~~~~~ .. class:: CheckboxSelectMultiple Similar to :class:`SelectMultiple`, but rendered as a list of check Loading @@ -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 Loading Loading @@ -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` Loading @@ -396,6 +452,8 @@ commonly used groups of widgets: Similar to :attr:`TimeInput.format` ``SplitHiddenDateTimeWidget`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. class:: SplitHiddenDateTimeWidget Loading @@ -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 Loading