req.py 524 B

123456789101112
  1. from wtforms import Form, SubmitField, StringField, PasswordField, IntegerField, FileField, validators, FloatField
  2. def is_empty(s: str):
  3. return s is None or len(s) == 0
  4. class ReplaceForm(Form):
  5. # background: 可以是图片文件名称,也可以是r,g,b,w或者是颜色的hex
  6. background = StringField(label="background", validators=[])
  7. bg_file_id = StringField("bg_file_id", validators=[])
  8. file_id = StringField(label="file_id", validators=[validators.DataRequired(message="请先上传图片")])