Skip to content

Max & Min

Majid Ahmaditabar edited this page Dec 10, 2021 · 2 revisions

max:value

  • The field under validation must be less than or equal to a maximum value.Strings and numerics are evaluated in the same fashion as the size rule.

min:value

  • The field under validation must have a minimum value. Strings and numerics are evaluated in the same fashion as the size rule.

data = {
  "age": 23,
}

rules = {
  "age": ["required", "min:18", "max:30"],

}

validate = PyValidation.make(data, rules)

Clone this wiki locally