open-law/app/forms/book.py

16 lines
382 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(6, 256)])
class CreateBookForm(BaseBookForm):
submit = SubmitField("Add new book")
class EditBookForm(BaseBookForm):
submit = SubmitField("Edit book")