open-law/app/forms/collection.py

17 lines
434 B
Python
Raw Normal View History

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