open-law/app/forms/comment.py

26 lines
736 B
Python

from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, BooleanField
from wtforms.validators import DataRequired, Length
class BaseCommentForm(FlaskForm):
text = StringField("Text", [DataRequired(), Length(3, 256)])
marked = BooleanField("Marked")
included_with_interpretation = BooleanField("Included")
parent_id = StringField("Text")
class CreateCommentForm(BaseCommentForm):
submit = SubmitField("Create")
class DeleteCommentForm(FlaskForm):
comment_id = StringField("Text")
submit = SubmitField("Delete")
class EditCommentForm(FlaskForm):
comment_id = StringField("Text")
text = StringField("Text", [DataRequired(), Length(3, 256)])
submit = SubmitField("Edit")