.. method:: Form.get_initial_for_field(field, field_name)
@@ -500,10 +500,10 @@ The second task of a ``Form`` object is to render itself as HTML. To do so,
>>> 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
@@ -519,16 +519,14 @@ 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:
+This default output wraps each field with a ``
``. Notice the following:
-* For flexibility, the output does *not* include the ``
`` and
- ``
`` tags, nor does it include the ````
+* For flexibility, the output does *not* include the ````
tags or an ```` tag. It's your job to do that.
* Each field type has a default HTML representation. ``CharField`` is
@@ -556,7 +554,7 @@ Notice the following:
it uses boolean attributes such as ``checked`` rather than the XHTML style
of ``checked='checked'``.
-Although ``
`` output is the default output style when you ``print`` a
+Although ``
`` output is the default output style when you ``print`` a
form, other output styles are available. Each style is available as a method on
a form object, and each rendering method returns a string.
@@ -584,7 +582,7 @@ class.
.. method:: Form.render(template_name=None, context=None, renderer=None)
-The render method is called by ``__str__`` as well as the
+The render method is called by ``__str__`` as well as the :meth:`.Form.as_div`,
:meth:`.Form.as_table`, :meth:`.Form.as_p`, and :meth:`.Form.as_ul` methods.
All arguments are optional and default to:
@@ -779,11 +777,11 @@ classes, as needed. The HTML will look something like:
.. code-block:: pycon
>>> f = ContactForm(data)
- >>> print(f.as_table())
-