2023-02-16 18:19:58 +04:00
|
|
|
"""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
|
2023-02-16 18:19:58 +04:00
|
|
|
|
|
|
|
|
|
|
|
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()],
|
|
|
|
)
|