csv-library-website/library/application/forms/borrowform.py

20 lines
542 B
Python
Raw Normal View History

2024-03-30 18:09:04 +01:00
"""Form object declaration."""
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, validators
from wtforms.validators import Length
class BorrowForm(FlaskForm):
"""Borrow a publication form."""
borrowed = StringField(
"Fill in your name if you're going to borrow this publication.",
[
validators.InputRequired(),
Length(
min=3, message="Just so we know who is borrowing this book."
),
],
)
submit = SubmitField("Borrow")