Custom Validators
Build your own validation logic on top of the validate function.
Extend the built-in validate() with custom rules.
from gdtest_sec_index_hero import validate
def validate_positive(record):
base_ok = validate({'value': int}, record)
return base_ok and record['value'] > 0
assert validate_positive({'value': 42})
assert not validate_positive({'value': -1})