Skip to content

Commit 5306285

Browse files
committed
Complemented documentation following commit be9ae69
Refs django#17840. Thanks Carl Meyer for noticing the omission.
1 parent 9f7b277 commit 5306285

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

docs/ref/forms/fields.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,10 @@ For each field, we describe the default widget used if you don't specify
467467
The ``max_value`` and ``min_value`` error messages may contain
468468
``%(limit_value)s``, which will be substituted by the appropriate limit.
469469

470+
.. versionchanged:: 1.6
471+
Similarly, the ``max_digits``, ``max_decimal_places`` and
472+
``max_whole_digits`` error messages may contain ``%(max)s``.
473+
470474
Takes four optional arguments:
471475

472476
.. attribute:: max_value
@@ -1013,6 +1017,11 @@ objects (in the case of ``ModelMultipleChoiceField``) into the
10131017
The empty and normalized values were changed to be consistently
10141018
``QuerySets`` instead of ``[]`` and ``QuerySet`` respectively.
10151019

1020+
.. versionchanged:: 1.6
1021+
The ``invalid_choice`` message may contain ``%(value)s`` and the
1022+
``invalid_pk_value`` message may contain ``%(pk)s``, which will be
1023+
substituted by the appropriate values.
1024+
10161025
Allows the selection of one or more model objects, suitable for
10171026
representing a many-to-many relation. As with :class:`ModelChoiceField`,
10181027
you can use ``label_from_instance`` to customize the object

docs/releases/1.6.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,13 @@ Miscellaneous
423423
``type='email'``, ``type='url'`` or ``type='number'`` depending on their
424424
corresponding field type.
425425

426+
* Form field's :attr:`~django.forms.Field.error_messages` that contain a
427+
placeholder should now always use a named placeholder (``"Value '%(value)s' is
428+
too big"`` instead of ``"Value '%s' is too big"``). See the corresponding
429+
field documentation for details about the names of the placeholders. The
430+
changes in 1.6 particularly affect :class:`~django.forms.DecimalField` and
431+
:class:`~django.forms.ModelMultipleChoiceField`.
432+
426433
Features deprecated in 1.6
427434
==========================
428435

0 commit comments

Comments
 (0)