from wtforms import StringField
class FormulaField(StringField):
def process_formdata(self, valuelist):
if valuelist:
self.data = [guard(i) for i in valuelist]
else:
self.data = []
from flask_wtf import FlaskForm
class MathForm(FlaskForm):
formula = FormulaField('Формула', validators=[DataRequired()])