Loading docs/ref/forms/fields.txt +5 −5 Original line number Diff line number Diff line Loading @@ -299,7 +299,7 @@ as the rendered output. See the :ref:`format localization <format-localization>` documentation for more information. .. _built-in fields: .. _built-in-fields: Built-in ``Field`` classes -------------------------- Loading Loading @@ -957,12 +957,12 @@ Slightly complex built-in ``Field`` classes def __init__(self, *args, **kwargs): # Define one message for all fields. 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. fields = ( CharField(error_messages={'incomplete': 'Enter a country code.'}, validators=[RegexValidator(r'^[0-9]+$', 'Enter a valid country code.')]), CharField(error_messages={'incomplete': 'Enter a country calling code.'}, validators=[RegexValidator(r'^[0-9]+$', 'Enter a valid country calling code.')]), CharField(error_messages={'incomplete': 'Enter a phone number.'}, validators=[RegexValidator(r'^[0-9]+$', 'Enter a valid phone number.')]), CharField(validators=[RegexValidator(r'^[0-9]+$', 'Enter a valid extension.')], Loading docs/ref/forms/widgets.txt +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ Specifying widgets 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 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 just use the :attr:`~Field.widget` argument on the field definition. For Loading docs/topics/http/file-uploads.txt +1 −1 File changed.Contains only whitespace changes. Show changes Loading
docs/ref/forms/fields.txt +5 −5 Original line number Diff line number Diff line Loading @@ -299,7 +299,7 @@ as the rendered output. See the :ref:`format localization <format-localization>` documentation for more information. .. _built-in fields: .. _built-in-fields: Built-in ``Field`` classes -------------------------- Loading Loading @@ -957,12 +957,12 @@ Slightly complex built-in ``Field`` classes def __init__(self, *args, **kwargs): # Define one message for all fields. 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. fields = ( CharField(error_messages={'incomplete': 'Enter a country code.'}, validators=[RegexValidator(r'^[0-9]+$', 'Enter a valid country code.')]), CharField(error_messages={'incomplete': 'Enter a country calling code.'}, validators=[RegexValidator(r'^[0-9]+$', 'Enter a valid country calling code.')]), CharField(error_messages={'incomplete': 'Enter a phone number.'}, validators=[RegexValidator(r'^[0-9]+$', 'Enter a valid phone number.')]), CharField(validators=[RegexValidator(r'^[0-9]+$', 'Enter a valid extension.')], Loading
docs/ref/forms/widgets.txt +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ Specifying widgets 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 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 just use the :attr:`~Field.widget` argument on the field definition. For Loading