mirror of
https://github.com/django/django.git
synced 2025-07-23 05:05:17 +00:00
Fixed #26107 -- Added option to int_list_validator() to allow negative integers.
This commit is contained in:
parent
b954ad0640
commit
d58aaa24e3
4 changed files with 22 additions and 5 deletions
|
@ -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``
|
||||
---------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue