open-law/app/forms/comment.py

24 lines
598 B
Python
Raw Normal View History

2023-05-08 12:19:22 +00:00
from flask_wtf import FlaskForm
2023-05-12 08:59:00 +00:00
from wtforms import StringField, SubmitField
2023-05-08 12:19:22 +00:00
from wtforms.validators import DataRequired, Length
class BaseCommentForm(FlaskForm):
text = StringField("Text", [DataRequired(), Length(3, 256)])
class CreateCommentForm(BaseCommentForm):
2023-05-12 08:59:00 +00:00
parent_id = StringField("Text")
tags = StringField("Tags")
2023-05-08 12:19:22 +00:00
submit = SubmitField("Create")
2023-05-09 08:37:23 +00:00
class DeleteCommentForm(FlaskForm):
comment_id = StringField("Text")
submit = SubmitField("Delete")
2023-05-09 14:32:07 +00:00
2023-05-12 08:59:00 +00:00
class EditCommentForm(BaseCommentForm):
2023-05-09 14:32:07 +00:00
comment_id = StringField("Text")
submit = SubmitField("Edit")