Skip to content

Numbers

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

numeric

  • The field under validation must be numeric.

digits:value

  • The field under validation must be numeric and must have an exact length of value.

data = {
  "month": 30,
  "year": 2020,
}

rules = {
  "month": ["required", "numeric"],
  "year": ["required", "digits:4"],
}

validate = PyValidations.make(data, rules)
Clone this wiki locally