From ff05de760cc4ef4c7f188e163c722ec3bc1f0cbf Mon Sep 17 00:00:00 2001
From: Jon Dufresne
Date: Sat, 20 Jan 2018 23:09:10 -0800
Subject: Fixed #29038 -- Removed closing slash from HTML void tags.
---
docs/ref/forms/api.txt | 222 ++++++++++++++++++++++-----------------------
docs/ref/forms/fields.txt | 50 +++++-----
docs/ref/forms/widgets.txt | 34 +++----
3 files changed, 153 insertions(+), 153 deletions(-)
(limited to 'docs/ref/forms')
diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt
index 5e001a2f62..bafa688f98 100644
--- a/docs/ref/forms/api.txt
+++ b/docs/ref/forms/api.txt
@@ -255,9 +255,9 @@ precedence::
... comment = forms.CharField()
>>> f = CommentForm(initial={'name': 'instance'}, auto_id=False)
>>> print(f)
-
Name:
-
Url:
-
Comment:
+
Name:
+
Url:
+
Comment:
.. method:: Form.get_initial_for_field(field, field_name)
@@ -322,10 +322,10 @@ You can alter the field of :class:`Form` instance to change the way it is
presented in the form::
>>> f.as_table().split('\n')[0]
- '
'
Beware not to alter the ``base_fields`` attribute because this modification
will influence all subsequent ``ContactForm`` instances within the same Python
@@ -334,7 +334,7 @@ process::
>>> f.base_fields['name'].label = "Username"
>>> another_f = CommentForm(auto_id=False)
>>> another_f.as_table().split('\n')[0]
- '
Username:
'
+ '
Username:
'
Accessing "clean" data
======================
@@ -438,10 +438,10 @@ simply ``print`` it::
>>> f = ContactForm()
>>> print(f)
-
-
-
-
+
+
+
+
If the form is bound to data, the HTML output will include that data
appropriately. For example, if a field is represented by an
@@ -455,10 +455,10 @@ include ``checked`` if appropriate::
... 'cc_myself': True}
>>> f = ContactForm(data)
>>> print(f)
-
-
-
-
+
+
+
+
This default output is a two-column HTML table, with a ``
`` for each field.
Notice the following:
@@ -506,12 +506,12 @@ containing one field::
>>> f = ContactForm()
>>> f.as_p()
- '
``as_table()``
--------------
@@ -543,12 +543,12 @@ it calls its ``as_table()`` method behind the scenes::
>>> f = ContactForm()
>>> f.as_table()
- '
\n
\n
\n
'
+ '
\n
\n
\n
'
>>> print(f)
-
-
-
-
+
+
+
+
.. _ref-forms-api-styling-form-rows:
@@ -618,20 +618,20 @@ tags nor ``id`` attributes::
>>> f = ContactForm(auto_id=False)
>>> print(f.as_table())
-
Subject:
-
Message:
-
Sender:
-
Cc myself:
+
Subject:
+
Message:
+
Sender:
+
Cc myself:
>>> print(f.as_ul())
-
Subject:
-
Message:
-
Sender:
-
Cc myself:
+
Subject:
+
Message:
+
Sender:
+
Cc myself:
>>> print(f.as_p())
-
Subject:
-
Message:
-
Sender:
-
Cc myself:
+
Subject:
+
Message:
+
Sender:
+
Cc myself:
If ``auto_id`` is set to ``True``, then the form output *will* include
``
-
Subject:
-
Message:
+
Subject:
+
Message:
Enter a valid email address.
-
Sender:
-
Cc myself:
+
Sender:
+
Cc myself:
.. _ref-forms-error-list-format:
@@ -824,11 +824,11 @@ pass that in at construction time::
>>> f = ContactForm(data, auto_id=False, error_class=DivErrorList)
>>> f.as_p()
This field is required.
-
Subject:
-
Message:
+
Subject:
+
Message:
Enter a valid email address.
-
Sender:
-
Cc myself:
+
Sender:
+
Cc myself:
More granular output
====================
@@ -848,25 +848,25 @@ using the field's name as the key::
>>> form = ContactForm()
>>> print(form['subject'])
-
+
To retrieve all ``BoundField`` objects, iterate the form::
>>> form = ContactForm()
>>> for boundfield in form: print(boundfield)
-
-
-
-
+
+
+
+
The field-specific output honors the form object's ``auto_id`` setting::
>>> f = ContactForm(auto_id=False)
>>> print(f['message'])
-
+
>>> f = ContactForm(auto_id='id_%s')
>>> print(f['message'])
-
+
Attributes of ``BoundField``
----------------------------
@@ -897,7 +897,7 @@ Attributes of ``BoundField``
>>> data = {'subject': 'hi', 'message': '', 'sender': '', 'cc_myself': ''}
>>> f = ContactForm(data, auto_id=False)
>>> print(f['message'])
-
+
>>> f['message'].errors
['This field is required.']
>>> print(f['message'].errors)
@@ -949,7 +949,7 @@ Attributes of ``BoundField``
.. code-block:: html
- ...
+ ...
.. attribute:: BoundField.is_hidden
@@ -1168,11 +1168,11 @@ fields are ordered first::
... priority = forms.CharField()
>>> f = ContactFormWithPriority(auto_id=False)
>>> print(f.as_ul())
-
Subject:
-
Message:
-
Sender:
-
Cc myself:
-
Priority:
+
Subject:
+
Message:
+
Sender:
+
Cc myself:
+
Priority:
It's possible to subclass multiple forms, treating forms as mixins. In this
example, ``BeatleForm`` subclasses both ``PersonForm`` and ``InstrumentForm``
@@ -1189,10 +1189,10 @@ classes::
... haircut_type = forms.CharField()
>>> b = BeatleForm(auto_id=False)
>>> print(b.as_ul())
-
First name:
-
Last name:
-
Instrument:
-
Haircut type:
+
First name:
+
Last name:
+
Instrument:
+
Haircut type:
It's possible to declaratively remove a ``Field`` inherited from a parent class
by setting the name of the field to ``None`` on the subclass. For example::
@@ -1222,11 +1222,11 @@ You can put several Django forms inside one ``