class InsightForm(FlaskForm): body = TextAreaField('body', validators=[validators.InputRequired()])
class SearchForm(FlaskForm): choices = [('Student', 'Student'), ('Faculty', 'Faculty'), ('Major', 'Major'), ('Subject', 'Subject')] select = SelectField('Search', [validators.InputRequired()], choices=choices) search = StringField('') submit = SubmitField('Submit')
class DeleteForm(FlaskForm): password = PasswordField('Password', [validators.InputRequired(), validators.Length(min=5, max=25)]) submit = SubmitField('Submit')
class LoginForm(FlaskForm): username = StringField( 'Username*', [validators.InputRequired("Please enter your name.")]) password = PasswordField( 'Password*', [validators.InputRequired("Please enter your password.")]) submit = SubmitField('Login')
class InputSize(FlaskForm): NPop = IntegerField('Number of populations', validators = [validators.InputRequired(), validators.NumberRange(min=0)]) NPlant = IntegerField('Number of plants', validators = [validators.InputRequired(), validators.NumberRange(min=0)]) LifeSpan = IntegerField('Life Span of project', validators = [validators.InputRequired(), validators.NumberRange(min=0)])
class InputForm(Form): NBVL = FloatField(label='coefficient low', default=18, validators=[validators.InputRequired()]) NBV = FloatField(label='coefficient', default=18, validators=[validators.InputRequired()]) BV = FloatField(label='Brakedown voltage [V]', default=18, validators=[validators.InputRequired()]) IBVL = FloatField(label='time interval (s)', default=18, validators=[validators.InputRequired()]) IBV = FloatField(label='time interval (s)', default=18, validators=[validators.InputRequired()]) Isr = FloatField(label='time interval (s)', default=18, validators=[validators.InputRequired()]) Vj = FloatField(label='time interval (s)', default=18, validators=[validators.InputRequired()]) M = FloatField(label='time interval (s)', default=18, validators=[validators.InputRequired()]) NR = FloatField(label='time interval (s)', default=18, validators=[validators.InputRequired()]) IKF = FloatField(label='time interval (s)', default=18, validators=[validators.InputRequired()]) N = FloatField(label='time interval (s)', default=18, validators=[validators.InputRequired()]) Is = FloatField(label='time interval (s)', default=18, validators=[validators.InputRequired()])
class AddTagForm(FlaskForm): tag = StringField('Enter tag:', [validators.InputRequired("Please enter the tag")]) submit = SubmitField('Add Tag')
class DatasetForm(Form): """ A form used to create an image processing dataset """ def validate_folder_path(form, field): if not field.data: pass else: # make sure the filesystem path exists if not os.path.exists(field.data) or not os.path.isdir(field.data): raise validators.ValidationError( 'Folder does not exist or is not reachable') else: return True train_image_folder = utils.forms.StringField( u'Training image folder', validators=[ validators.DataRequired(), validate_folder_path, ], tooltip="Indicate a folder of images to use for training") train_label_folder = utils.forms.StringField( u'Training label folder', validators=[ validators.DataRequired(), validate_folder_path, ], tooltip="Indicate a folder of training labels") val_image_folder = utils.forms.StringField( u'Validation image folder', validators=[ validate_required_if_set('val_label_folder'), validate_folder_path, ], tooltip="Indicate a folder of images to use for training") val_label_folder = utils.forms.StringField( u'Validation label folder', validators=[ validate_required_if_set('val_image_folder'), validate_folder_path, ], tooltip="Indicate a folder of validation labels") resize_image_width = utils.forms.IntegerField( u'Resize Image Width', validators=[ validate_required_if_set('resize_image_height'), validators.NumberRange(min=1), ], tooltip= "If specified, images will be resized to that dimension after padding") resize_image_height = utils.forms.IntegerField( u'Resize Image Height', validators=[ validate_required_if_set('resize_image_width'), validators.NumberRange(min=1), ], tooltip= "If specified, images will be resized to that dimension after padding") padding_image_width = utils.forms.IntegerField( u'Padding Image Width', default=1248, validators=[ validate_required_if_set('padding_image_height'), validators.NumberRange(min=1), ], tooltip="If specified, images will be padded to that dimension") padding_image_height = utils.forms.IntegerField( u'Padding Image Height', default=384, validators=[ validate_required_if_set('padding_image_width'), validators.NumberRange(min=1), ], tooltip="If specified, images will be padded to that dimension") channel_conversion = utils.forms.SelectField( u'Channel conversion', choices=[ ('RGB', 'RGB'), ('L', 'Grayscale'), ('none', 'None'), ], default='RGB', tooltip="Perform selected channel conversion.") val_min_box_size = utils.forms.IntegerField( u'Minimum box size (in pixels) for validation set', default='25', validators=[ validators.InputRequired(), validators.NumberRange(min=0), ], tooltip="Retain only the boxes that are larger than the specified " "value in both dimensions. This only affects objects in " "the validation set. Enter 0 to disable this threshold.") custom_classes = utils.forms.StringField( u'Custom classes', validators=[ validators.Optional(), ], tooltip="Enter a comma-separated list of class names. " "Class IDs are assigned sequentially, starting from 0. " "Unmapped class names automatically map to 0. " "Leave this field blank to use default class mappings. " "See object detection extension documentation for more " "information.")
class CreateExchangeForm(Form): name = StringField(label='Name', validators=[validators.InputRequired()]) description = TextAreaField(label='Description', validators=[validators.InputRequired()]) ends_at = DateField(label='End date', validators=[validators.InputRequired()])
class LoginForm(Form): email = StringField('Email', validators=[v.InputRequired(), v.Email()]) password = PasswordField('Password', validators=[v.InputRequired()]) submit = SubmitField('Login')
class InputForm(Form): q = FloatField(validators=[validators.InputRequired()]) r = FloatField(validators=[validators.InputRequired()])
class CustomerLogin(FlaskForm): email = StringField( 'email', validators=[validators.InputRequired(), validators.Email()]) password = PasswordField('password', validators=[validators.InputRequired()])
class DisagreeForm(FlaskForm): form_body = TextAreaField('body', validators=[validators.InputRequired()])
class ActionsTaken(FlaskForm): form_body = TextAreaField('body', validators=[validators.InputRequired()])
class changeVLAN(Form): vlan = IntegerField('VLAN ID', [validators.InputRequired()])
class LoginForm(Form): email = StringField(label='Email', validators=[validators.InputRequired()]) password = PasswordField(label='Password', validators=[validators.InputRequired()])
class CategoryForm(Form): category = StringField( 'Category', [validators.InputRequired(), validators.length(min=1, max=100)])
class CommentForm(BaseForm): post_id = wtforms.IntegerField(validators=[validators.InputRequired(message=u'请填入帖子信息!')]) content = wtforms.StringField(validators=[validators.InputRequired(message=u'请填入帖子内容!')]) comment_id = wtforms.IntegerField()
class CreateUserForm(Form): name = StringField('name', [ validators.InputRequired(), validators.Length(min=4, max=userNameMaxLength) ]) password = PasswordField('password', [validators.InputRequired()])
class Register(flask_wtf.FlaskForm): username = wtforms.StringField( label="Username", validators=[ validators.Regexp( regex="^\w+$", # noqa message="Username contains invalid characters.", ), validators.InputRequired(message="Please enter a username."), validators.Length( min=4, max=64, message="Username must between 4 and 64 characters long.", ), custom_validators.IUnique( model=models.Account, field=models.Account.username, message="This username already exists.", ), ], ) display = wtforms.StringField( label="Display name", validators=[ validators.Length( max=100, message="Display name must be less than 100 characters long.", ), ], ) email = wtforms.StringField( label="Email", validators=[ validators.InputRequired(message="Please enter an email address."), validators.Email(message="Please enter a valid email address."), validators.Length( min=4, max=120, message="Email must be between 4 and 120 characters long.", ), custom_validators.IUnique( model=models.Account, field=models.Account.email, message="This email already exists.", ), ], ) password = wtforms.PasswordField( label="Password", validators=[ validators.InputRequired(message="Please enter your password."), validators.Length( min=8, max=255, message="Password must be between 8 and 255 characters long.", ), ], ) confirm_password = wtforms.PasswordField( label="Confirm password", validators=[ validators.InputRequired(message="Please re-enter your password."), validators.EqualTo( fieldname="password", message="Passwords do not match." ), ], ) submit = wtforms.SubmitField(label="Submit")
class ChangeEmailForm(FlaskForm): email = StringField('Email*', [ validators.InputRequired("Please enter our email"), validators.Email('Email format incorrect') ]) submit = SubmitField('Update Email')
class GroupForm(form.Form): name = fields.StringField(u'组名', [validators.Required()]) gtype = fields.SelectField(u'组类型', [validators.InputRequired()], coerce=str, choices=GROUP_TYPE) memo = fields.StringField(u'备注', [validators.Optional()])
class SensorLocationForm(FlaskForm): indoor = BooleanField(_("Indoor Sensor"), ) street_name = StringField( _('Street'), [RequiredIf(indoor=False, message=_('Please enter the street name.'))]) street_number = StringField(_('Street number')) postalcode = StringField( _('Postal code'), [RequiredIf(indoor=False, message=_('Please enter the postal code.'))]) city = StringField( _('City'), [RequiredIf(indoor=False, message=_('Please enter the city name.'))]) country = SelectField( _('Country'), [ validators.InputRequired( message=_('Please enter the country name.'), ), validators.NoneOf( ['--'], message=_('Please enter the country name.'), ) ], choices=country_codes, ) latitude = StringField(_('Latitude'), default="0.0", validators=[ RequiredIf( indoor=False, message=_('Please enter the latitude.')) ]) longitude = StringField(_('Longitude'), default="0.0", validators=[ RequiredIf( indoor=False, message=_('Please enter the longitude.')) ]) industry_in_area = IntegerField( _('How much industrial activity is there within a 100m radius?'), [ # validators.InputRequired( # message=_('Please give your estimate.'), # ), validators.Optional(), validators.NumberRange( min=1, max=10, message=_('Please enter the number between 1 and 10'), ) ], description= _('No office space, but potential fine dust producers 1 = very little, 10 = very much.' ), ) oven_in_area = IntegerField( _('How many private stoves or fireplaces are within a 100m radius?'), [ # validators.InputRequired( # message=_('Please give your estimate.'), # ), validators.Optional(), validators.NumberRange( min=1, max=10, message=_('Please enter the number between 1 and 10'), ) ], description= _('Does it smell very much like such smoke in your area? 1 = very little, 10 = very much.' ), ) traffic_in_area = IntegerField( _('How much traffic is there within a 100m radius?'), [ # validators.InputRequired( # message=_('Please give your estimate.'), # ), validators.Optional(), validators.NumberRange( min=1, max=10, message=_('Please enter the number between 1 and 10'), ) ], description= _('How close are those roads? 1 = very little further away, 10 = a lot of traffic right on your doorstep.' ), )
class CsrfForm(Form): """Simple form to handle rendering a CSRF token and confirming it is included in the POST.""" csrf_token = HiddenField("", [validators.InputRequired()])
class MyForm(FlaskForm): name = StringField("Your name", [validators.InputRequired()]) email = StringField("Email", [validators.InputRequired(), validators.Email()]) message = StringField("Message", [validators.InputRequired()])
class LoginForm(FlaskForm): username = StringField('username', [validators.DataRequired()]) password = PasswordField( 'password', [validators.DataRequired(), validators.InputRequired()])
class LoginForm(FlaskForm): username = StringField('Username', [validators.InputRequired(), validators.Length(min=5, max=25)]) password = PasswordField('Password', [validators.InputRequired(), validators.Length(min=5, max=25)]) remember_me = BooleanField('Remember Me', default=True) submit = SubmitField('Submit')
class setDescription(Form): description = StringField('Description', [validators.InputRequired()])
class QuizForm(FlaskForm): first = StringField('First Name', [validators.InputRequired()]) last = StringField('Last Name', [validators.InputRequired()]) age = IntegerField('Age', [ validators.NumberRange(min=10, message='Must be at least %(min)d years old.') ]) gender = StringField('Gender', [ validators.InputRequired(message='What is your gender? Male or Female') ]) allergies = StringField( 'Do You Have Allergies? Yes or No', [validators.InputRequired(message='Do you have allergies? Yes or No')]) exercise = StringField( 'Do you Exercise More than 3 times a week? Yes or No', [ validators.InputRequired( message='Do you workout more than 3 days a week? Yes or No') ]) high_bp = StringField('Do you have High Blood Pressure? Yes or No', [ validators.InputRequired( message='Do you have high blood pressure? Yes or No') ]) diabetes = StringField( 'Do you have Diabetes yes or no?', [validators.InputRequired(message='Do you have diabetes? Yes or No')]) muscle_building = StringField( 'Are you trying to build muscle? Yes or No', [ validators.InputRequired( message='Are you trying to build muscle? Yes or No') ]) weight_loss = StringField('Are you trying to loss weight? Yes or No', [ validators.InputRequired( message='Are you trying to lose weight? Yes or No') ]) hungry_often = StringField( 'Are you hungry often? Yes or No', [validators.InputRequired(message='Are you hungry often? Yes or No')]) eat_snacks = StringField( 'Do you eat snacks? Yes or No', [validators.InputRequired(message='Do you eat snacks? Yes or No')]) submit = SubmitField('View Free Plan')
class TaskForm(FlaskForm): title = StringField('task title', validators=[validators.InputRequired()])