From 5dceb1f07807d76f163ce1929e9f1dc1b2da6289 Mon Sep 17 00:00:00 2001 From: "Elif T. Kus" Date: Sun, 3 Jan 2016 12:56:22 +0200 Subject: [1.9.x] Fixed #26020 -- Normalized header stylings in docs. Backport of bca9faae95db2a92e540fbd08505c134639916fe from master --- docs/ref/forms/api.txt | 48 +++++++++++----------- docs/ref/forms/fields.txt | 96 +++++++++++++++++++++---------------------- docs/ref/forms/formsets.txt | 2 +- docs/ref/forms/models.txt | 4 +- docs/ref/forms/validation.txt | 21 +++++----- docs/ref/forms/widgets.txt | 41 +++++++++--------- 6 files changed, 107 insertions(+), 105 deletions(-) (limited to 'docs/ref/forms') diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt index a8d2fa77ff..072525ff53 100644 --- a/docs/ref/forms/api.txt +++ b/docs/ref/forms/api.txt @@ -13,7 +13,7 @@ The Forms API .. _ref-forms-api-bound-unbound: Bound and unbound forms ------------------------ +======================= A :class:`Form` instance is either **bound** to a set of data, or **unbound**. @@ -69,7 +69,7 @@ another :class:`Form` instance. There is no way to change data in a should consider its data immutable, whether it has data or not. Using forms to validate data ----------------------------- +============================ .. method:: Form.clean() @@ -203,7 +203,7 @@ This includes ``ValidationError``\s that are raised in :meth:`Form.clean() "...") `. Behavior of unbound forms -~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------------- It's meaningless to validate a form with no data, but, for the record, here's what happens with unbound forms:: @@ -215,7 +215,7 @@ what happens with unbound forms:: {} Dynamic initial values ----------------------- +====================== .. attribute:: Form.initial @@ -251,7 +251,7 @@ precedence:: Comment: Checking which form data has changed ------------------------------------- +==================================== .. method:: Form.has_changed() @@ -288,7 +288,7 @@ provided in :attr:`~Form.initial`. It returns an empty list if no data differs. ... print("The following fields changed: %s" % ", ".join(f.changed_data)) Accessing the fields from the form ----------------------------------- +================================== .. attribute:: Form.fields @@ -322,7 +322,7 @@ process:: 'Username:' Accessing "clean" data ----------------------- +====================== .. attribute:: Form.cleaned_data @@ -416,7 +416,7 @@ fields). More information about this is in :doc:`/ref/forms/validation`. .. _ref-forms-api-outputting-html: Outputting forms as HTML ------------------------- +======================== The second task of a ``Form`` object is to render itself as HTML. To do so, simply ``print`` it:: @@ -478,7 +478,7 @@ form, other output styles are available. Each style is available as a method on a form object, and each rendering method returns a Unicode object. ``as_p()`` -~~~~~~~~~~ +---------- .. method:: Form.as_p() @@ -495,7 +495,7 @@ containing one field::

``as_ul()`` -~~~~~~~~~~~ +----------- .. method:: Form.as_ul() @@ -514,7 +514,7 @@ flexibility::
  • ``as_table()`` -~~~~~~~~~~~~~~ +-------------- .. method:: Form.as_table() @@ -534,7 +534,7 @@ it calls its ``as_table()`` method behind the scenes:: .. _ref-forms-api-styling-form-rows: Styling required or erroneous form rows -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--------------------------------------- .. attribute:: Form.error_css_class .. attribute:: Form.required_css_class @@ -578,7 +578,7 @@ classes, as needed. The HTML will look something like:: .. _ref-forms-api-configuring-label: Configuring form elements' HTML ``id`` attributes and ``