From 9b5f64cc6ed5f1e904093fe4e6ff0f681b8e545f Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 1 Jan 2013 08:12:42 -0500 Subject: Fixed #19516 - Fixed remaining broken links. Added -n to sphinx builds to catch issues going forward. --- docs/ref/forms/api.txt | 41 +++++++++++++++++++++-------------------- docs/ref/forms/widgets.txt | 12 ++++++------ 2 files changed, 27 insertions(+), 26 deletions(-) (limited to 'docs/ref/forms') diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt index ab1f4b0eea..4aacbf0a0d 100644 --- a/docs/ref/forms/api.txt +++ b/docs/ref/forms/api.txt @@ -2,9 +2,7 @@ The Forms API ============= -.. module:: django.forms.forms - -.. currentmodule:: django.forms +.. module:: django.forms .. admonition:: About this document @@ -380,6 +378,9 @@ a form object, and each rendering method returns a Unicode object. Styling required or erroneous form rows ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. attribute:: Form.error_css_class +.. attribute:: Form.required_css_class + It's pretty common to style form rows and fields that are required or have errors. For example, you might want to present required form rows in bold and highlight errors in red. @@ -587,24 +588,24 @@ lazy developers -- they're not the only way a form object can be displayed. Used to display HTML or access attributes for a single field of a :class:`Form` instance. - The :meth:`__unicode__` and :meth:`__str__` methods of this object displays + The ``__unicode__()`` and ``__str__()`` methods of this object displays the HTML for this field. To retrieve a single ``BoundField``, use dictionary lookup syntax on your form using the field's name as the key:: - >>> form = ContactForm() - >>> print(form['subject']) - + >>> form = ContactForm() + >>> print(form['subject']) + To retrieve all ``BoundField`` objects, iterate the form:: - >>> form = ContactForm() - >>> for boundfield in form: print(boundfield) - - - - + >>> form = ContactForm() + >>> for boundfield in form: print(boundfield) + + + + The field-specific output honors the form object's ``auto_id`` setting:: @@ -635,7 +636,7 @@ For a field's list of errors, access the field's ``errors`` attribute. >>> print(f['subject'].errors) >>> str(f['subject'].errors) - '' + '' .. method:: BoundField.css_classes() @@ -644,17 +645,17 @@ indicate required form fields or fields that contain errors. If you're manually rendering a form, you can access these CSS classes using the ``css_classes`` method:: - >>> f = ContactForm(data) - >>> f['message'].css_classes() - 'required' + >>> f = ContactForm(data) + >>> f['message'].css_classes() + 'required' If you want to provide some additional classes in addition to the error and required classes that may be required, you can provide those classes as an argument:: - >>> f = ContactForm(data) - >>> f['message'].css_classes('foo bar') - 'foo bar required' + >>> f = ContactForm(data) + >>> f['message'].css_classes('foo bar') + 'foo bar required' .. method:: BoundField.value() diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index d8d9c9b770..bc1270094b 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -508,9 +508,9 @@ Selector and checkbox widgets .. attribute:: Select.choices - This attribute is optional when the field does not have a - :attr:`~Field.choices` attribute. If it does, it will override anything - you set here when the attribute is updated on the :class:`Field`. + This attribute is optional when the form field does not have a + ``choices`` attribute. If it does, it will override anything you set + here when the attribute is updated on the :class:`Field`. ``NullBooleanSelect`` ~~~~~~~~~~~~~~~~~~~~~ @@ -660,9 +660,9 @@ Composite widgets .. attribute:: MultipleHiddenInput.choices - This attribute is optional when the field does not have a - :attr:`~Field.choices` attribute. If it does, it will override anything - you set here when the attribute is updated on the :class:`Field`. + This attribute is optional when the form field does not have a + ``choices`` attribute. If it does, it will override anything you set + here when the attribute is updated on the :class:`Field`. ``SplitDateTimeWidget`` ~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.3