25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
788 B

  1. # -*- coding: utf-8 -*-
  2. """
  3. :author: Grey Li ()
  4. :url: http://greyli.com
  5. :copyright: © 2018 Grey Li <withlihui@gmail.com>
  6. :license: MIT, see LICENSE for more details.
  7. """
  8. from flask_wtf import FlaskForm
  9. from wtforms import StringField, SubmitField, TextAreaField
  10. from wtforms.validators import DataRequired, Optional, Length
  11. class DescriptionForm(FlaskForm):
  12. description = TextAreaField('描述', validators=[Optional(), Length(0, 500)])
  13. submit = SubmitField('提交')
  14. class TagForm(FlaskForm):
  15. tag = StringField('增加标签 (使用空格分开)', validators=[Optional(), Length(0, 64)])
  16. submit = SubmitField('提交')
  17. class CommentForm(FlaskForm):
  18. body = TextAreaField('', validators=[DataRequired()])
  19. submit = SubmitField('提交')