1
0
mirror of https://github.com/django/django.git synced 2025-08-23 18:29:12 +00:00

[1.7.x] Fixed #23169 - Misc docs fixes.

Backport of e4dd8b5dde from master
This commit is contained in:
areski 2014-08-04 13:29:59 +02:00 committed by Tim Graham
parent d723da383d
commit a582431b41
3 changed files with 7 additions and 7 deletions

View File

@ -279,7 +279,7 @@ as the rendered output.
See the :ref:`format localization <format-localization>` documentation for See the :ref:`format localization <format-localization>` documentation for
more information. more information.
.. _built-in fields: .. _built-in-fields:
Built-in ``Field`` classes Built-in ``Field`` classes
-------------------------- --------------------------
@ -930,12 +930,12 @@ Slightly complex built-in ``Field`` classes
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
# Define one message for all fields. # Define one message for all fields.
error_messages = { error_messages = {
'incomplete': 'Enter a country code and phone number.', 'incomplete': 'Enter a country calling code and a phone number.',
} }
# Or define a different message for each field. # Or define a different message for each field.
fields = ( fields = (
CharField(error_messages={'incomplete': 'Enter a country code.'}, CharField(error_messages={'incomplete': 'Enter a country calling code.'},
validators=[RegexValidator(r'^\d+$', 'Enter a valid country code.')]), validators=[RegexValidator(r'^\d+$', 'Enter a valid country calling code.')]),
CharField(error_messages={'incomplete': 'Enter a phone number.'}, CharField(error_messages={'incomplete': 'Enter a phone number.'},
validators=[RegexValidator(r'^\d+$', 'Enter a valid phone number.')]), validators=[RegexValidator(r'^\d+$', 'Enter a valid phone number.')]),
CharField(validators=[RegexValidator(r'^\d+$', 'Enter a valid extension.')], CharField(validators=[RegexValidator(r'^\d+$', 'Enter a valid extension.')],

View File

@ -27,7 +27,7 @@ Specifying widgets
Whenever you specify a field on a form, Django will use a default widget Whenever you specify a field on a form, Django will use a default widget
that is appropriate to the type of data that is to be displayed. To find that is appropriate to the type of data that is to be displayed. To find
which widget is used on which field, see the documentation about which widget is used on which field, see the documentation about
:ref:`built-in fields`. :ref:`built-in-fields`.
However, if you want to use a different widget for a field, you can However, if you want to use a different widget for a field, you can
just use the :attr:`~Field.widget` argument on the field definition. For just use the :attr:`~Field.widget` argument on the field definition. For