nopaque/app/test/forms.py
2020-01-22 16:14:00 +01:00

13 lines
546 B
Python

from flask_wtf import FlaskForm
from flask_wtf.file import FileAllowed, FileField, FileRequired
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired, Length
class TestForm(FlaskForm):
description = StringField('Description',
validators=[DataRequired(), Length(1, 255)])
file = FileField('File', validators=[FileAllowed(['txt'], 'Plain text only!'), FileRequired()])
submit = SubmitField()
title = StringField('Title', validators=[DataRequired(), Length(1, 32)])