diff options
| author | Pavel Kulikov <kulikovpavel@gmail.com> | 2017-03-11 10:11:44 +0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-03-15 10:09:26 -0400 |
| commit | 3c1ed1d336c847ed35934b3169632455505f4acb (patch) | |
| tree | c6f6d6a9e740ea99e3be9b9341aa97bab918ce69 /docs/ref/forms | |
| parent | 1ed4dab20f694a47e964baaf2dab23c8455806bf (diff) | |
[1.11.x] Fixed #27918 -- Documented ChoiceWidget.option_template_name
Backport of 0d83052e52ddfe99c214be7ffca348a3c8feaef5 from master
Diffstat (limited to 'docs/ref/forms')
| -rw-r--r-- | docs/ref/forms/widgets.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index f0301c1eee..b5d4fc3d5d 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -621,6 +621,14 @@ These widgets make use of the HTML elements ``input`` and ``textarea``. Selector and checkbox widgets ----------------------------- +These widgets make use of the HTML elements ``<select>``, +``<input type='checkbox'>``, and ``<input type='radio'>``. + +Widgets that render multiple choices have an ``option_template_name`` attribute +that specifies the template used to render each choice. For example, for the +:class:`Select` widget, ``select_option.html`` renders the ``<option>`` for a +``<select>``. + ``CheckboxInput`` ~~~~~~~~~~~~~~~~~ @@ -643,6 +651,7 @@ Selector and checkbox widgets .. class:: Select * ``template_name``: ``'django/forms/widgets/select.html'`` + * ``option_template_name``: ``'django/forms/widgets/select_option.html'`` * Renders as: ``<select><option ...>...</select>`` .. attribute:: Select.choices @@ -657,6 +666,7 @@ Selector and checkbox widgets .. class:: NullBooleanSelect * ``template_name``: ``'django/forms/widgets/select.html'`` + * ``option_template_name``: ``'django/forms/widgets/select_option.html'`` Select widget with options 'Unknown', 'Yes' and 'No' @@ -666,6 +676,7 @@ Selector and checkbox widgets .. class:: SelectMultiple * ``template_name``: ``'django/forms/widgets/select.html'`` + * ``option_template_name``: ``'django/forms/widgets/select_option.html'`` Similar to :class:`Select`, but allows multiple selection: ``<select multiple='multiple'>...</select>`` @@ -676,6 +687,7 @@ Selector and checkbox widgets .. class:: RadioSelect * ``template_name``: ``'django/forms/widgets/radio.html'`` + * ``option_template_name``: ``'django/forms/widgets/radio_option.html'`` Similar to :class:`Select`, but rendered as a list of radio buttons within ``<li>`` tags: @@ -770,6 +782,7 @@ Selector and checkbox widgets .. class:: CheckboxSelectMultiple * ``template_name``: ``'django/forms/widgets/checkbox_select.html'`` + * ``option_template_name``: ``'django/forms/widgets/checkbox_option.html'`` Similar to :class:`SelectMultiple`, but rendered as a list of check buttons: |
