open-law/app/forms/interpretation.py

21 lines
659 B
Python
Raw Normal View History

2023-05-04 15:14:17 +03:00
from flask_wtf import FlaskForm
2023-05-05 12:02:35 +03:00
from wtforms import StringField, SubmitField
2023-05-04 15:14:17 +03:00
from wtforms.validators import DataRequired, Length
class BaseInterpretationForm(FlaskForm):
label = StringField("Label", [DataRequired(), Length(3, 256)])
about = StringField("About")
class CreateInterpretationForm(BaseInterpretationForm):
section_id = StringField("Interpretation ID", [DataRequired()])
text = StringField("Text")
submit = SubmitField("Create")
2023-05-04 16:32:56 +03:00
class EditInterpretationForm(BaseInterpretationForm):
interpretation_id = StringField("Interpretation ID", [DataRequired()])
text = StringField("Text")
submit = SubmitField("Edit")