mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #26107 -- Added option to int_list_validator() to allow negative integers.
This commit is contained in:
@@ -226,12 +226,17 @@ to, or in lieu of custom ``field.clean()`` methods.
|
||||
``int_list_validator``
|
||||
----------------------
|
||||
|
||||
.. function:: int_list_validator(sep=',', message=None, code='invalid')
|
||||
.. function:: int_list_validator(sep=',', message=None, code='invalid', allow_negative=False)
|
||||
|
||||
.. versionadded:: 1.9
|
||||
|
||||
Returns a :class:`RegexValidator` instance that ensures a string
|
||||
consists of integers separated by ``sep``.
|
||||
Returns a :class:`RegexValidator` instance that ensures a string consists
|
||||
of integers separated by ``sep``. It allows negative integers when
|
||||
``allow_negative`` is ``True``.
|
||||
|
||||
.. versionchanged:: 1.10
|
||||
|
||||
The ``allow_negative`` parameter was added.
|
||||
|
||||
``MaxValueValidator``
|
||||
---------------------
|
||||
|
||||
@@ -355,6 +355,10 @@ Validators
|
||||
domain name labels to 63 characters and the total length of domain
|
||||
names to 253 characters per :rfc:`1034`.
|
||||
|
||||
* :func:`~django.core.validators.int_list_validator` now accepts an optional
|
||||
``allow_negative`` boolean parameter, defaulting to ``False``, to allow
|
||||
negative integers.
|
||||
|
||||
Backwards incompatible changes in 1.10
|
||||
======================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user