tmpl-flask/flaskapp/forms.py

26 lines
630 B
Python
Raw Normal View History

"""Flask app forms"""
from flask_wtf import FlaskForm # type: ignore
from wtforms import StringField # type: ignore
from wtforms import IntegerField
from wtforms import PasswordField
2023-02-16 18:21:15 +04:00
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()],
)