OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python37
/
lib
/
python3.7
/
site-packages
/
validators
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
09/05/2025 09:36:16 AM
rwxr-xr-x
📄
__init__.py
1.08 KB
06/05/2022 05:11:31 PM
rw-r--r--
📁
__pycache__
-
03/16/2023 12:57:03 PM
rwxr-xr-x
📄
between.py
1.54 KB
10/10/2015 06:47:54 AM
rw-r--r--
📄
btc_address.py
1.49 KB
12/18/2020 10:22:34 AM
rw-r--r--
📄
card.py
4.28 KB
05/07/2020 12:32:08 PM
rw-r--r--
📄
domain.py
1.29 KB
10/05/2021 06:21:42 AM
rw-r--r--
📄
email.py
1.93 KB
04/02/2020 01:03:56 PM
rw-r--r--
📄
extremes.py
991 bytes
08/30/2016 02:58:11 PM
rw-r--r--
📄
hashes.py
2.44 KB
06/03/2017 02:07:19 PM
rw-r--r--
📁
i18n
-
03/16/2023 12:57:03 PM
rwxr-xr-x
📄
iban.py
1.14 KB
05/09/2016 03:06:26 PM
rw-r--r--
📄
ip_address.py
3.99 KB
06/05/2022 05:04:06 PM
rw-r--r--
📄
length.py
970 bytes
10/10/2015 06:47:54 AM
rw-r--r--
📄
mac_address.py
836 bytes
10/10/2015 06:47:54 AM
rw-r--r--
📄
slug.py
529 bytes
10/10/2015 06:47:54 AM
rw-r--r--
📄
truthy.py
876 bytes
10/05/2021 06:21:42 AM
rw-r--r--
📄
url.py
4.82 KB
06/05/2022 05:11:01 PM
rw-r--r--
📄
utils.py
1.97 KB
10/05/2021 06:21:42 AM
rw-r--r--
📄
uuid.py
970 bytes
09/03/2020 07:35:41 AM
rw-r--r--
Editing: between.py
Close
from .extremes import Max, Min from .utils import validator @validator def between(value, min=None, max=None): """ Validate that a number is between minimum and/or maximum value. This will work with any comparable type, such as floats, decimals and dates not just integers. This validator is originally based on `WTForms NumberRange validator`_. .. _WTForms NumberRange validator: https://github.com/wtforms/wtforms/blob/master/wtforms/validators.py Examples:: >>> from datetime import datetime >>> between(5, min=2) True >>> between(13.2, min=13, max=14) True >>> between(500, max=400) ValidationFailure(func=between, args=...) >>> between( ... datetime(2000, 11, 11), ... min=datetime(1999, 11, 11) ... ) True :param min: The minimum required value of the number. If not provided, minimum value will not be checked. :param max: The maximum value of the number. If not provided, maximum value will not be checked. .. versionadded:: 0.2 """ if min is None and max is None: raise AssertionError( 'At least one of `min` or `max` must be specified.' ) if min is None: min = Min if max is None: max = Max try: min_gt_max = min > max except TypeError: min_gt_max = max < min if min_gt_max: raise AssertionError('`min` cannot be more than `max`.') return min <= value and max >= value