Closed nikalosa closed 4 years ago
Enhance validator to read rule as a function
Example:
from validator import validate def func_age(x): return x >= 18 # Dummy Checker def func_mail(x): return "@" in x rules = {"name": lambda x: len(x) > 1000, "age": func_age, "mail": func_mail} req = {"name": "Jon", "age": 30, "mail": "JonDoe@gmail.com"} validate(req, rules)
Enhance validator to read rule as a function
Example: