From 18ffdb1772ba60e085cff8fd9a1d4a7b129b4032 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 16 Sep 2013 12:52:05 -0400 Subject: Fixed #17627 -- Renamed util.py files to utils.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks PaulM for the suggestion and Luke Granger-Brown and Wiktor KoƂodziej for the initial patch. --- docs/ref/forms/api.txt | 8 ++++++-- docs/ref/forms/validation.txt | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'docs/ref/forms') diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt index f084273cd9..977da4b7be 100644 --- a/docs/ref/forms/api.txt +++ b/docs/ref/forms/api.txt @@ -571,12 +571,12 @@ method you're using:: Customizing the error list format ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -By default, forms use ``django.forms.util.ErrorList`` to format validation +By default, forms use ``django.forms.utils.ErrorList`` to format validation errors. If you'd like to use an alternate class for displaying errors, you can pass that in at construction time (replace ``__unicode__`` by ``__str__`` on Python 3):: - >>> from django.forms.util import ErrorList + >>> from django.forms.utils import ErrorList >>> class DivErrorList(ErrorList): ... def __unicode__(self): ... return self.as_divs() @@ -592,6 +592,10 @@ Python 3)::

Sender:

Cc myself:

+.. versionchanged:: 1.7 + + ``django.forms.util`` was renamed to ``django.forms.utils``. + More granular output ~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/ref/forms/validation.txt b/docs/ref/forms/validation.txt index b6113098bb..c1e619113c 100644 --- a/docs/ref/forms/validation.txt +++ b/docs/ref/forms/validation.txt @@ -219,10 +219,10 @@ through the ``Form.non_field_errors()`` method. When you really do need to attach the error to a particular field, you should store (or amend) a key in the ``Form._errors`` attribute. This attribute is an -instance of a ``django.forms.util.ErrorDict`` class. Essentially, though, it's +instance of a ``django.forms.utils.ErrorDict`` class. Essentially, though, it's just a dictionary. There is a key in the dictionary for each field in the form that has an error. Each value in the dictionary is a -``django.forms.util.ErrorList`` instance, which is a list that knows how to +``django.forms.utils.ErrorList`` instance, which is a list that knows how to display itself in different ways. So you can treat ``_errors`` as a dictionary mapping field names to lists. -- cgit v1.3