tmpl-flask/flaskapp/forms.py
2023-02-16 18:21:15 +04:00

25 lines
630 B
Python

"""Flask app forms"""
from flask_wtf import FlaskForm # type: ignore
from wtforms import StringField # type: ignore
from wtforms import IntegerField
from wtforms import PasswordField
from wtforms.validators import DataRequired # type: ignore
class AddForm(FlaskForm):
"""Sample form for adding users to DB"""
pswd = PasswordField('Admin password (1234)')
email = StringField(
'Person\'s email',
validators=[DataRequired()],
)
name = StringField(
'Name',
validators=[DataRequired()],
)
age = IntegerField(
'Age',
validators=[DataRequired()],
)