I would like to reformat the data submitted via WTForms by utilizing the process_data function. I am able to successfully submit the form, however, the data is not modified in the output as expected. I've included a simplified example of my forms.py file below.
The goal of this form would be to input the value of "10,000" and return the string "10000".
from flask_wtf import FlaskForm
from wtforms import StringField
class SimpleForm(FlaskForm):
price = StringField('price')
def process_price(self, price):
price.data = str(price).replace(',','')