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")
|
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")
|