mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #24531 -- Improved CommaSeparatedIntegerField validation.
`','`, `'1,,1'`, `',1'` etc. are no longer considered as valid comma-separated integer lists.
This commit is contained in:
parent
f4cc0c40a8
commit
3e64f3d0fc
5 changed files with 49 additions and 17 deletions
|
@ -214,6 +214,16 @@ to, or in lieu of custom ``field.clean()`` methods.
|
|||
A :class:`RegexValidator` instance that ensures a value is a
|
||||
comma-separated list of integers.
|
||||
|
||||
``int_list_validator``
|
||||
----------------------
|
||||
|
||||
.. function:: int_list_validator(sep=',', message=None, code='invalid')
|
||||
|
||||
.. versionadded:: 1.9
|
||||
|
||||
Returns a :class:`RegexValidator` instance that ensures a string
|
||||
consists of integers separated by ``sep``.
|
||||
|
||||
``MaxValueValidator``
|
||||
---------------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue