diff options
| author | David Smith <smithdc@gmail.com> | 2022-05-05 09:21:47 +0200 |
|---|---|---|
| committer | Carlton Gibson <carlton@noumenal.es> | 2022-05-05 14:32:43 +0200 |
| commit | ec5659382a5f5fc2daf0c87ccc89d0fb07534874 (patch) | |
| tree | 08a5183708f3490b97f61098d26272901d25b822 /docs/topics/forms | |
| parent | 27b07a3246bc033cd9ded01238c6dc64731cce35 (diff) | |
Fixed #32339 -- Added div.html form template.
Diffstat (limited to 'docs/topics/forms')
| -rw-r--r-- | docs/topics/forms/formsets.txt | 16 | ||||
| -rw-r--r-- | docs/topics/forms/index.txt | 8 |
2 files changed, 18 insertions, 6 deletions
diff --git a/docs/topics/forms/formsets.txt b/docs/topics/forms/formsets.txt index 0206959f1d..1b54f2accb 100644 --- a/docs/topics/forms/formsets.txt +++ b/docs/topics/forms/formsets.txt @@ -800,12 +800,22 @@ Formsets have the following attributes and methods associated with rendering: In older versions ``template_name`` defaulted to the string value ``'django/forms/formset/default.html'``. + +.. attribute:: BaseFormSet.template_name_div + + .. versionadded:: 4.1 + + The name of the template used when calling :meth:`.as_div`. By default this + is ``"django/forms/formsets/div.html"``. This template renders the + formset's management form and then each form in the formset as per the + form's :meth:`~django.forms.Form.as_div` method. + .. attribute:: BaseFormSet.template_name_p .. versionadded:: 4.0 The name of the template used when calling :meth:`.as_p`. By default this - is ``'django/forms/formsets/p.html'``. This template renders the formset's + is ``"django/forms/formsets/p.html"``. This template renders the formset's management form and then each form in the formset as per the form's :meth:`~django.forms.Form.as_p` method. @@ -814,7 +824,7 @@ Formsets have the following attributes and methods associated with rendering: .. versionadded:: 4.0 The name of the template used when calling :meth:`.as_table`. By default - this is ``'django/forms/formsets/table.html'``. This template renders the + this is ``"django/forms/formsets/table.html"``. This template renders the formset's management form and then each form in the formset as per the form's :meth:`~django.forms.Form.as_table` method. @@ -823,7 +833,7 @@ Formsets have the following attributes and methods associated with rendering: .. versionadded:: 4.0 The name of the template used when calling :meth:`.as_ul`. By default this - is ``'django/forms/formsets/ul.html'``. This template renders the formset's + is ``"django/forms/formsets/ul.html"``. This template renders the formset's management form and then each form in the formset as per the form's :meth:`~django.forms.Form.as_ul` method. diff --git a/docs/topics/forms/index.txt b/docs/topics/forms/index.txt index c8e43389a0..e153d73bab 100644 --- a/docs/topics/forms/index.txt +++ b/docs/topics/forms/index.txt @@ -566,12 +566,14 @@ Form rendering options There are other output options though for the ``<label>``/``<input>`` pairs: +* ``{{ form.as_div }}`` will render them wrapped in ``<div>`` tags. + * ``{{ form.as_table }}`` will render them as table cells wrapped in ``<tr>`` - tags + tags. -* ``{{ form.as_p }}`` will render them wrapped in ``<p>`` tags +* ``{{ form.as_p }}`` will render them wrapped in ``<p>`` tags. -* ``{{ form.as_ul }}`` will render them wrapped in ``<li>`` tags +* ``{{ form.as_ul }}`` will render them wrapped in ``<li>`` tags. Note that you'll have to provide the surrounding ``<table>`` or ``<ul>`` elements yourself. |
