-
Notifications
You must be signed in to change notification settings - Fork 0
Alpha and String
Majid Ahmaditabar edited this page Dec 10, 2021
·
3 revisions
- The field under validation must be a string. If you would like to allow the field to also be null, you should assign the nullable rule to the field.
- The field under validation must be entirely alphabetic characters.
- The field under validation must start with the given values.
- The field under validation must end with the given values
data = {
"name": "John Doe",
"user_name": "John_007",
"start_code": "G123other_string",
"end_code": "other_stringG123"
}
rules = {
"name": ["required", "alpha"],
"user_name": ["required", "string"],
"start_code": ["required", "start_with:G123"],
"end_code": ["required", "end_with:G123"],
}
validate = PyValidation.make(data, rules)