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=5, validators = [NumberRange(min=0, max=100)]) retention_type = SelectField('Retention', choices = [ 'Minute', 'Hour', 'Day', 'Time'], default=2, validators = [Required()]) submit = SubmitField('Shorten Url')