open-law/app/forms/collection.py

17 lines
434 B
Python
Raw Normal View History

2023-04-26 13:14:57 +00:00
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired, Length
2023-04-28 07:50:59 +00:00
class BaseCollectionForm(FlaskForm):
2023-04-28 07:15:10 +00:00
label = StringField("Label", [DataRequired(), Length(3, 256)])
2023-04-26 13:14:57 +00:00
about = StringField("About")
2023-04-28 07:50:59 +00:00
class CreateCollectionForm(BaseCollectionForm):
submit = SubmitField("Create")
2023-04-26 13:14:57 +00:00
2023-04-28 07:50:59 +00:00
class EditCollectionForm(BaseCollectionForm):
2023-04-26 13:14:57 +00:00
submit = SubmitField("Edit")