2023-04-24 06:57:38 +00:00
|
|
|
from flask_wtf import FlaskForm
|
2023-04-26 13:14:57 +00:00
|
|
|
from wtforms import StringField, SubmitField
|
2023-04-24 06:57:38 +00:00
|
|
|
from wtforms.validators import DataRequired, Length
|
|
|
|
|
|
|
|
|
2023-05-01 15:17:46 +00:00
|
|
|
class BaseBookForm(FlaskForm):
|
2023-04-27 13:17:25 +00:00
|
|
|
label = StringField("Label", [DataRequired(), Length(6, 256)])
|
2023-05-01 15:17:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
class CreateBookForm(BaseBookForm):
|
2023-04-24 06:57:38 +00:00
|
|
|
submit = SubmitField("Add new book")
|
2023-05-01 15:17:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
class EditBookForm(BaseBookForm):
|
|
|
|
submit = SubmitField("Edit book")
|