Class method custom validation

Report a typo

We have the following class for student application.

We need a custom validation where the password should be rejected if it contains the word orange in it.

Note: The letters of orange can be in either lowercase or uppercase.

Write a validation method in the class to do the check.

Write a program in Python 3
from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms.validators import ValidationError

# Form
class StudentForm(FlaskForm):
name = StringField("name")
password = StringField("password")

# ... Insert your code here
___

Create a free account to access the full topic