summaryrefslogtreecommitdiff
path: root/docs/ref/forms/fields.txt
diff options
context:
space:
mode:
authorAnnabelle Wiegart <annabelle.wiegart@proton.me>2026-01-18 20:03:28 +0100
committerJacob Walls <jacobtylerwalls@gmail.com>2026-04-22 17:06:29 -0400
commit63c56cda133a85a158502891c40465bc0331d3d9 (patch)
tree04380903d14307b71416b2e048ce4be8361cf0df /docs/ref/forms/fields.txt
parentdc467fdc3b5744cec71fab876c23a14013e2510b (diff)
Fixed #35870 -- Made blank choice label in forms more accessible.
Added new constant django.db.models.fields.BLANK_CHOICE_LABEL for an accessible and translatable blank choice label in forms. Deprecated django.db.models.fields.BLANK_CHOICE_DASH constant. Added the immediately deprecated transitional setting USE_BLANK_CHOICE_DASH. Co-Authored-By: Marijke Luttekes <mail@marijkeluttekes.dev>
Diffstat (limited to 'docs/ref/forms/fields.txt')
-rw-r--r--docs/ref/forms/fields.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt
index 73faa8cc18..085b36a0e5 100644
--- a/docs/ref/forms/fields.txt
+++ b/docs/ref/forms/fields.txt
@@ -1384,7 +1384,7 @@ generating choices. See :ref:`iterating-relationship-choices` for details.
By default the ``<select>`` widget used by ``ModelChoiceField`` will
have an empty choice at the top of the list. You can change the text of
- this label (which is ``"---------"`` by default) with the
+ this label (which is ``"- Select an option -"`` by default) with the
``empty_label`` attribute, or you can disable the empty label entirely
by setting ``empty_label`` to ``None``::
@@ -1400,6 +1400,11 @@ generating choices. See :ref:`iterating-relationship-choices` for details.
:class:`~django.forms.RadioSelect` and the
:attr:`~ModelChoiceField.blank` argument is ``False``.
+ .. versionchanged:: 6.1
+
+ The default empty label was changed from ``"---------"`` to
+ ``"- Select an option -"``.
+
.. attribute:: to_field_name
This optional argument is used to specify the field to use as the value