Answer the question
In order to leave comments, you need to log in
How to fasten the field validation?
Hello everyone
Who came across, tell me how to file validation of fields based on regexps in flask? In this case, the regular expression must be given by a variable.
operator_name = TextField('operator_name', [Required(),\
#Regexp(allowed_characters, message = message)])
Regexp('A-Za-z',message = 'wrong symbol, try again')])
Answer the question
In order to leave comments, you need to log in
Can try to do validation in form method like
def validate_operator_name(self, field):
if not field.data:
raise ValidationError("Error!")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question