Q:

Everything submitted to Flask Form is a string, which always fails form validation

I am trying to get a basic Flask Form set up, but realizing that everything I submit to the form is read in as a string:
from flask import blueprints, render_template
from flask import request
from wtforms import Form, DecimalField,
from wtforms.validators import NumberRange
    class PredictionForm(Form):
        inputfield = DecimalField("Impressions", validators=[NumberRange(min=0.0, max=1.0, message="Not valid")
        anotherinput = DecimalField('View Rate', validators=[NumberRange(min=0.0, max=1.0, message="Not valid")])

    @blueprint.route("/", methods=["POST", "GET"])
    def index():
        form = PredictionForm()
        print(request.form)
        print(form.validate()) # this always returns False!
        if request.method == "POST":
            print(request.form)

When I print requests.form, I get the following output:
ImmutableMultiDict([('inputfield', '0'), ('anotherinput', '0.5'))])
I think this is why my form validation continually returns false, since clearly any value that is a string is not a number between 0 and 1. How do I get Flask to recognize my input values as numbers?
If this is NOT the reason why my validation is failing, please do let me know as well.
Note: I am printing request.form to debug - so I can see what type of data is being passed into my form. I know I can clearly validate on the server-side, by doing something like
input_field = request.form['input_field']
if input_field.isnumber():
  ... some more logic
However, all of this is happening on the backend server-side. The whole point of using these Flask validators is that I DON'T need to do this validation server-side. For instance, if I change my validation for a field called spend:
 class PredictionForm(Form):
        inputfield = DecimalField("Impressions", validators=[NumberRange(min=0.0, max=1.0, message="Not valid")
        anotherinput = DecimalField('View Rate', validators=[NumberRange(min=0.0, max=1.0, message="Not valid")])
        spend = DecimalField('Spend', validators=[DataRequired()])

This works perfectly on my frontend, since if I attempt to submit my form with no input for spend, I get this message:

A:

I have found my issue - I am not passing in the request.form to my PredictionForm instantiation:
@blueprint.route("/", methods=["POST", "GET"])
def index():
    form = PredictionForm(request.form)
    form.validate() # this validates correctly now!

On the frontend, if the user does not enter a valid number for the Decimal value, he/she will get an error message.

