1
0
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:
Tai Lee
2013-05-07 19:06:03 +10:00
committed by Tim Graham
parent c33d1ca1d9
commit 1280675834
4 changed files with 139 additions and 9 deletions

View File

@@ -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
=====================================