mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #2364: added NumberIsInRange validator. Thanks, Matt McClanahan.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4039 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -610,6 +610,15 @@ fails. If no message is passed in, a default message is used.
|
||||
string "123" is less than the string "2", for example. If you don't want
|
||||
string comparison here, you will need to write your own validator.
|
||||
|
||||
``NumberIsInRange``
|
||||
Takes two boundary number, ``lower`` and ``upper`` and checks that the
|
||||
field is greater than ``lower`` (if given) and less than ``upper`` (if
|
||||
given).
|
||||
|
||||
Both checks are inclusive; that is, ``NumberIsInRange(10, 20)`` will allow
|
||||
values of both 10 and 20. This validator only checks numeric fields
|
||||
(i.e. floats and integer fields).
|
||||
|
||||
``IsAPowerOf``
|
||||
Takes an integer argument and when called as a validator, checks that the
|
||||
field being validated is a power of the integer.
|
||||
|
||||
Reference in New Issue
Block a user