2021-04-17 21:15:45 +02:00
|
|
|
"""Form object declaration."""
|
|
|
|
from flask_wtf import FlaskForm
|
2023-11-26 18:38:33 +01:00
|
|
|
from wtforms import StringField, SubmitField, validators
|
2021-04-17 21:15:45 +02:00
|
|
|
from wtforms.validators import Length
|
|
|
|
|
|
|
|
|
|
|
|
class BorrowForm(FlaskForm):
|
2021-04-18 00:07:16 +02:00
|
|
|
"""Borrow a publication form."""
|
2021-04-17 21:15:45 +02:00
|
|
|
|
|
|
|
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."
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
secret = StringField(
|
|
|
|
"Librarians secret:",
|
|
|
|
[
|
|
|
|
validators.InputRequired(),
|
2023-11-26 18:38:33 +01:00
|
|
|
Length(min=2, message="Fill in the secret to unlock to library."),
|
2021-04-17 21:15:45 +02:00
|
|
|
],
|
|
|
|
)
|
|
|
|
submit = SubmitField("Borrow")
|