Ticket #16602: forms_widget.diff

File forms_widget.diff, 4.6 KB (added by Ken Cochrane, 13 years ago)

Forms.widget documentation patch

  • docs/ref/forms/widgets.txt

     
    171171Django provides a representation of all the basic HTML widgets, plus some
    172172commonly used groups of widgets:
    173173
     174``Widget``
     175~~~~~~~~~~
     176
    174177.. class:: Widget
    175178
    176179    This abstract class cannot be rendered, but provides the basic attribute :attr:`~Widget.attrs`.
     
    185188            >>> name.render('name', 'A name')
    186189            u'<input title="Your name" type="text" name="name" value="A name" size="10" />'
    187190
     191``TextInput``
     192~~~~~~~~~~~~~
    188193
    189194.. class:: TextInput
    190195
    191196    Text input: ``<input type='text' ...>``
    192197
     198``PasswordInput``
     199~~~~~~~~~~~~~~~~~
     200
    193201.. class:: PasswordInput
    194202
    195203    Password input: ``<input type='password' ...>``
     
    206214            :attr:`~PasswordInput.render_value` was
    207215            changed from ``True`` to ``False``
    208216
     217``HiddenInput``
     218~~~~~~~~~~~~~~~
     219
    209220.. class:: HiddenInput
    210221
    211222    Hidden input: ``<input type='hidden' ...>``
    212223
     224``MultipleHiddenInput``
     225~~~~~~~~~~~~~~~~~~~~~~~
     226
    213227.. class:: MultipleHiddenInput
    214228
    215229    Multiple ``<input type='hidden' ...>`` widgets.
     
    223237        :attr:`~Field.choices` attribute. If it does, it will override anything
    224238        you set here when the attribute is updated on the :class:`Field`.
    225239
     240``FileInput``
     241~~~~~~~~~~~~~
     242
    226243.. class:: FileInput
    227244
    228245    File upload input: ``<input type='file' ...>``
    229246
     247``ClearableFileInput``
     248~~~~~~~~~~~~~~~~~~~~~~
     249
    230250.. class:: ClearableFileInput
    231251
    232252    .. versionadded:: 1.3
     
    235255    input to clear the field's value, if the field is not required and has
    236256    initial data.
    237257
     258``DateInput``
     259~~~~~~~~~~~~~
     260
    238261.. class:: DateInput
    239262
    240263    Date input as a simple text box: ``<input type='text' ...>``
     
    249272    format found in :setting:`DATE_INPUT_FORMATS` and respects
    250273    :ref:`format-localization`.
    251274
     275``DateTimeInput``
     276~~~~~~~~~~~~~~~~~
     277
    252278.. class:: DateTimeInput
    253279
    254280    Date/time input as a simple text box: ``<input type='text' ...>``
     
    263289    format found in :setting:`DATETIME_INPUT_FORMATS` and respects
    264290    :ref:`format-localization`.
    265291
     292``TimeInput``
     293~~~~~~~~~~~~~
     294
    266295.. class:: TimeInput
    267296
    268297    Time input as a simple text box: ``<input type='text' ...>``
     
    277306    format found in :setting:`TIME_INPUT_FORMATS` and respects
    278307    :ref:`format-localization`.
    279308
     309``Textarea``
     310~~~~~~~~~~~~
     311
    280312.. class:: Textarea
    281313
    282314    Text area: ``<textarea>...</textarea>``
    283315
     316``CheckboxInput``
     317~~~~~~~~~~~~~~~~~
     318
    284319.. class:: CheckboxInput
    285320
    286321    Checkbox: ``<input type='checkbox' ...>``
     
    292327        A callable that takes the value of the CheckBoxInput and returns
    293328        ``True`` if the checkbox should be checked for that value.
    294329
     330``Select``
     331~~~~~~~~~~
     332
    295333.. class:: Select
    296334
    297335    Select widget: ``<select><option ...>...</select>``
     
    302340        :attr:`~Field.choices` attribute. If it does, it will override anything
    303341        you set here when the attribute is updated on the :class:`Field`.
    304342
     343``NullBooleanSelect``
     344~~~~~~~~~~~~~~~~~~~~~
     345
    305346.. class:: NullBooleanSelect
    306347
    307348    Select widget with options 'Unknown', 'Yes' and 'No'
    308349
     350``SelectMultiple``
     351~~~~~~~~~~~~~~~~~~
     352
    309353.. class:: SelectMultiple
    310354
    311355    Similar to :class:`Select`, but allows multiple selection:
    312356    ``<select multiple='multiple'>...</select>``
    313357
     358``RadioSelect``
     359~~~~~~~~~~~~~~~
     360
    314361.. class:: RadioSelect
    315362
    316363    Similar to :class:`Select`, but rendered as a list of radio buttons:
     
    322369          ...
    323370        </ul>
    324371
     372``CheckboxSelectMultiple``
     373~~~~~~~~~~~~~~~~~~~~~~~~~~
     374
    325375.. class:: CheckboxSelectMultiple
    326376
    327377    Similar to :class:`SelectMultiple`, but rendered as a list of check
     
    334384          ...
    335385        </ul>
    336386
     387``MultiWidget``
     388~~~~~~~~~~~~~~~
     389
    337390.. class:: MultiWidget
    338391
    339392    Wrapper around multiple other widgets. You'll probably want to use this
     
    381434
    382435        An iterable containing the widgets needed.
    383436
     437``SplitDateTimeWidget``
     438~~~~~~~~~~~~~~~~~~~~~~~
     439
    384440.. class:: SplitDateTimeWidget
    385441
    386442    Wrapper (using :class:`MultiWidget`) around two widgets: :class:`DateInput`
     
    396452
    397453        Similar to :attr:`TimeInput.format`
    398454
     455``SplitHiddenDateTimeWidget``
     456~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    399457
    400458.. class:: SplitHiddenDateTimeWidget
    401459
     
    404462
    405463.. currentmodule:: django.forms.extras.widgets
    406464
     465``SelectDateWidget``
     466~~~~~~~~~~~~~~~~~~~~
     467
    407468.. class:: SelectDateWidget
    408469
    409470    Wrapper around three :class:`~django.forms.Select` widgets: one each for
Back to Top