from flask_wtf import FlaskForm from wtforms import StringField, IntegerField, SelectField, SubmitField from wtforms.validators import DataRequired, NumberRange, Required class UrlForm(FlaskForm): url = StringField('Url', validators=[DataRequired()]) retention = IntegerField('Retention', default=1, validators = [NumberRange(min=0, max=100)]) retention_type = SelectField('Retention', choices = [(1, 'Minute'), (2, 'Hour'), (3, 'Day'), (4, 'Time')], default=3, validators = [Required()]) submit = SubmitField('Shorten Url')