mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #15511 -- Allow optional fields on `MultiValueField subclasses.
The `MultiValueField` class gets a new ``require_all_fields`` argument that defaults to ``True``. If set to ``False``, individual fields can be made optional, and a new ``incomplete`` validation error will be raised if any required fields have empty values. The ``incomplete`` error message can be defined on a `MultiValueField` subclass or on each individual field. Skip duplicate errors.
This commit is contained in:
@@ -122,6 +122,11 @@ Minor features
|
||||
``html_email_template_name`` parameter used to send a multipart HTML email
|
||||
for password resets.
|
||||
|
||||
* :class:`~django.forms.MultiValueField` allows optional subfields by setting
|
||||
the ``require_all_fields`` argument to ``False``. The ``required`` attribute
|
||||
for each individual field will be respected, and a new ``incomplete``
|
||||
validation error will be raised when any required fields are empty.
|
||||
|
||||
Backwards incompatible changes in 1.7
|
||||
=====================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user