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