open-law/app/forms/book.py
SvyatoslavArtymovych 4b69a31055 flake8
2023-06-16 14:11:19 +03:00

19 lines
501 B
Python

from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired, Length
class BaseBookForm(FlaskForm):
label = StringField("Label", [DataRequired(), Length(4, 256)])
about = StringField("About")
tags = StringField("Tags")
class CreateBookForm(BaseBookForm):
submit = SubmitField("Add new book")
class EditBookForm(BaseBookForm):
book_id = StringField("User ID", [DataRequired()])
submit = SubmitField("Edit book")