I am migrating from Flask to FastAPI and it is not clear to me how FastAPI manages WTF Forms.
I would like to use forms in Classes. However, I don't know if there is a correct way to do it in FastAPI, and if not what is the recommended solution to manage forms easily.
Here is a code example:
from fastapi import Form
from wtforms import RadioField,SubmitField,SelectField, StringField,PasswordField, BooleanField
from wtforms.validators import Length, Email, InputRequired,EqualTo, DataRequired
class SignUpForm(Form):
email = StringField('Email', validators=[DataRequired(), Length(1,100),Email()])
password = ...
confirm_password = ...
Is it possible to handle Forms in this way in FastAPI?
FastAPI has already a page explaining Forms in general, but I didn't find any source explaining how to use it in a Class.
Any source to understand how FastAPI manages forms exactly is welcome.