From 4f16376274a4e52074722c615fccef5fac5f009a Mon Sep 17 00:00:00 2001
From: Claude Paroz
Date: Mon, 28 Jan 2013 14:12:56 +0100
Subject: Added HTML5 email input type
Refs #16630.
---
docs/ref/forms/api.txt | 53 +++++++++++++++++++++++++-------------------------
1 file changed, 27 insertions(+), 26 deletions(-)
(limited to 'docs/ref/forms/api.txt')
diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt
index d1f877ff65..44e4684c1d 100644
--- a/docs/ref/forms/api.txt
+++ b/docs/ref/forms/api.txt
@@ -270,7 +270,7 @@ simply ``print`` it::
>>> print(f)
-
+
If the form is bound to data, the HTML output will include that data
@@ -287,7 +287,7 @@ include ``checked="checked"`` if appropriate::
>>> print(f)
-
+
This default output is a two-column HTML table, with a ``
`` for each field.
@@ -297,8 +297,9 @@ Notice the following:
```` tags, nor does it include the ````
tags or an ```` tag. It's your job to do that.
-* Each field type has a default HTML representation. ``CharField`` and
- ``EmailField`` are represented by an ````.
+* Each field type has a default HTML representation. ``CharField`` is
+ represented by an ```` and ``EmailField`` by an
+ ````.
``BooleanField`` is represented by an ````. Note
these are merely sensible defaults; you can specify which HTML to use for
a given field by using widgets, which we'll explain shortly.
@@ -335,7 +336,7 @@ a form object, and each rendering method returns a Unicode object.
>>> print(f.as_p())
-
+
``as_ul()``
@@ -350,11 +351,11 @@ a form object, and each rendering method returns a Unicode object.
>>> f = ContactForm()
>>> f.as_ul()
- u'
\n
\n
\n
'
+ u'
\n
\n
\n
'
>>> print(f.as_ul())
-
+
``as_table()``
@@ -368,11 +369,11 @@ a form object, and each rendering method returns a Unicode object.
>>> f = ContactForm()
>>> f.as_table()
- u'
\n
\n
\n
'
+ u'
\n
\n
\n
'
>>> print(f.as_table())
-
+
Styling required or erroneous form rows
@@ -431,17 +432,17 @@ tags nor ``id`` attributes::
>>> print(f.as_table())
Subject:
Message:
-
Sender:
+
Sender:
Cc myself:
>>> print(f.as_ul())
Subject:
Message:
-
Sender:
+
Sender:
Cc myself:
>>> print(f.as_p())
Subject:
Message:
-
Sender:
+
Sender:
Cc myself:
If ``auto_id`` is set to ``True``, then the form output *will* include
@@ -452,17 +453,17 @@ field::
>>> print(f.as_table())
-
+
>>> print(f.as_ul())
-
+
>>> print(f.as_p())
-
+
If ``auto_id`` is set to a string containing the format character ``'%s'``,
@@ -475,17 +476,17 @@ attributes based on the format string. For example, for a format string
>>> print(f.as_table())
-
+
>>> print(f.as_ul())
-
+
>>> print(f.as_p())
-
+
If ``auto_id`` is set to any other true value -- such as a string that doesn't
@@ -501,13 +502,13 @@ entirely, using the ``label_suffix`` parameter::
>>> print(f.as_ul())
-
+
>>> f = ContactForm(auto_id='id_for_%s', label_suffix=' ->')
>>> print(f.as_ul())
-
+
Note that the label suffix is added only if the last character of the
@@ -539,19 +540,19 @@ method you're using::
>>> print(f.as_table())
Subject:
This field is required.
Message:
-
Sender:
Enter a valid email address.
+
Sender:
Enter a valid email address.
Cc myself:
>>> print(f.as_ul())
This field is required.
Subject:
Message:
-
Enter a valid email address.
Sender:
+
Enter a valid email address.
Sender:
Cc myself:
>>> print(f.as_p())
This field is required.
Subject:
Message:
Enter a valid email address.
-
Sender:
+
Sender:
Cc myself:
Customizing the error list format
@@ -574,7 +575,7 @@ pass that in at construction time::
Subject:
Message:
Enter a valid email address.
-
Sender:
+
Sender:
Cc myself:
More granular output
@@ -604,7 +605,7 @@ To retrieve all ``BoundField`` objects, iterate the form::
>>> for boundfield in form: print(boundfield)
-
+
The field-specific output honors the form object's ``auto_id`` setting::
@@ -756,7 +757,7 @@ fields are ordered first::
>>> print(f.as_ul())