From 4f16376274a4e52074722c615fccef5fac5f009a Mon Sep 17 00:00:00 2001
From: Claude Paroz Subject: Message: Sender: Sender: Cc myself:
-
+
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())
\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:
>>> print(f.as_ul())
Cc myself:
-
+
>>> print(f.as_ul())
-
+
>>> print(f.as_ul())
Subject:
- Message:
+ Sender: Sender:
>>> print(f.as_ul())
Cc myself:
Subject:
Sender:
Sender:
Subject:
Message:
Sender:
+Sender:
Cc myself:
Customizing the error list format @@ -574,7 +575,7 @@ pass that in at construction time::Subject:
Message:
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())Subject: 100 characters max.
Message:
-Sender: A valid email address, please.
+Sender: A valid email address, please.
Cc myself:
``error_messages`` @@ -489,7 +489,7 @@ For each field, we describe the default widget used if you don't specify .. class:: EmailField(**kwargs) - * Default widget: :class:`TextInput` + * Default widget: :class:`EmailInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value is a valid email address, using a diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index bc1270094b..9105a41b25 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -392,7 +392,16 @@ These widgets make use of the HTML elements ``input`` and ``textarea``. .. class:: TextInput - Text input: ```` + Text input: ```` + +``EmailInput`` +~~~~~~~~~~~~~~ + +.. class:: EmailInput + + .. versionadded:: 1.6 + + Text input: ```` ``PasswordInput`` ~~~~~~~~~~~~~~~~~ -- cgit v1.3