class SelScatForm(FlaskForm): scat = SelectField(u'sous-categorie',choices=[],validators=[]) submit2 = SubmitField('Validation scat')
class ArtistForm(Form): name = StringField('name', validators=[DataRequired()]) city = StringField('city', validators=[DataRequired()]) state = SelectField('state', validators=[DataRequired()], choices=[ ('AL', 'AL'), ('AK', 'AK'), ('AZ', 'AZ'), ('AR', 'AR'), ('CA', 'CA'), ('CO', 'CO'), ('CT', 'CT'), ('DE', 'DE'), ('DC', 'DC'), ('FL', 'FL'), ('GA', 'GA'), ('HI', 'HI'), ('ID', 'ID'), ('IL', 'IL'), ('IN', 'IN'), ('IA', 'IA'), ('KS', 'KS'), ('KY', 'KY'), ('LA', 'LA'), ('ME', 'ME'), ('MT', 'MT'), ('NE', 'NE'), ('NV', 'NV'), ('NH', 'NH'), ('NJ', 'NJ'), ('NM', 'NM'), ('NY', 'NY'), ('NC', 'NC'), ('ND', 'ND'), ('OH', 'OH'), ('OK', 'OK'), ('OR', 'OR'), ('MD', 'MD'), ('MA', 'MA'), ('MI', 'MI'), ('MN', 'MN'), ('MS', 'MS'), ('MO', 'MO'), ('PA', 'PA'), ('RI', 'RI'), ('SC', 'SC'), ('SD', 'SD'), ('TN', 'TN'), ('TX', 'TX'), ('UT', 'UT'), ('VT', 'VT'), ('VA', 'VA'), ('WA', 'WA'), ('WV', 'WV'), ('WI', 'WI'), ('WY', 'WY'), ]) phone = StringField('phone', validators=[DataRequired()]) image_link = StringField('image_link') genres = SelectMultipleField('genres', validators=[DataRequired()], choices=[ ('Alternative', 'Alternative'), ('Blues', 'Blues'), ('Classical', 'Classical'), ('Country', 'Country'), ('Electronic', 'Electronic'), ('Folk', 'Folk'), ('Funk', 'Funk'), ('Hip-Hop', 'Hip-Hop'), ('Heavy Metal', 'Heavy Metal'), ('Instrumental', 'Instrumental'), ('Jazz', 'Jazz'), ('Musical Theatre', 'Musical Theatre'), ('Pop', 'Pop'), ('Punk', 'Punk'), ('R&B', 'R&B'), ('Reggae', 'Reggae'), ('Rock n Roll', 'Rock n Roll'), ('Soul', 'Soul'), ('Other', 'Other'), ]) facebook_link = StringField('facebook_link', validators=[URL()])
class setReviewerForm(FlaskForm): id = HiddenField("id") reviewer = SelectField('Reviewer', choices=[], validators=[DataRequired()]) submit = SubmitField('Set Reviewer')
class BulkDeleteForm(FlaskForm): SCOPE = OrderedDict([('all_selected_items', 'All selected items'), ('all_items', 'Unselect/Delete ALL items')]) scope = SelectField('Privileges', [DataRequired()], choices=choices_from_dict(SCOPE, prepend_blank=False))
class NewAccountForm(FlaskForm): type = SelectField('Select new account type') def __init__(self, *args, **kwargs): super(NewAccountForm, self).__init__(*args, **kwargs) self.type.choices = Account.descriptions()
class ReportActionForm(FlaskForm): action = SelectField(choices=[('close', 'Close'), ('hide', 'Hide'), ('delete', 'Delete')]) torrent = HiddenField() report = HiddenField()
class TeamCaptainForm(BaseForm): # Choices are populated dynamically at form creation time captain_id = SelectField("Team Captain", choices=[], validators=[InputRequired()]) submit = SubmitField("Submit")
DataRequired(message='请填写邮箱'), Length(1, 64) ]) username = StringField( '用户名', validators=[ DataRequired(message='用户名不能为空'), Length(1, 64), Regexp( ur"^([0-9A-Za-z]|[\u4e00-\u9fa5])+([0-9A-Za-z]|[\u4e00-\u9fa5])*$", 0, message='用户名不能是特殊字符,比如@¥%.') ]) confirmed = BooleanField('确认') role = SelectField('角色', coerce=int) name = StringField('姓名:', validators=[Length(0, 64)]) location = StringField('住址:', validators=[Length(0, 64)]) about_me = TextAreaField('关于我:', validators=[Length(0, 40, message='简介不得超过35个字.')]) submit = SubmitField('保存资料') def __init__(self, user, *args, **kwargs): super(EditProfileAdminForm, self).__init__(*args, **kwargs) self.role.choices = [(role.id, role.name) for role in Role.\ query.order_by(Role.name).all()] self.user = user def validate_email(self, field): if field.data != self.user.email and User.query.filter_by(email=field.data)\ .first():
class PerPageForm(Form): bookmarks_per_page = SelectField('Bookmarks per page', choices=[('10', '10'), ('20', '20'), ('40', '40'), ('80', '80')], validators=[Required()])
class IMForm(FlaskForm): protocol = SelectField(choices=[('aim', 'AIM'), ('msn', 'MSN')]) username = TextField()
class RegisterForm(Form): user_type_choices = [('0', u'客服'), ('1', u'解题员')] user_type=SelectField(u'性别', choices=user_type_choices, default='0') email = TextField(u'邮箱地址*', validators=[DataRequired(), Email(message=u'请填写正确的邮箱地址')]) passwd = PasswordField(u'密码*', validators=[DataRequired(),Regexp('[\w\d-]{6,20}', message=u'密码必须为6-20位')]) passwd_confirm = PasswordField(u'确认密码*', validators=[DataRequired(), EqualTo('passwd', message=u'密码不一致')])
class OrderForm(FlaskForm): order = SelectField('Sort By', choices=[('new', 'Most Recent'), ('old', 'Oldest'), ('completed', 'Completed'), ('incompleted', 'Incompleted')]) submit = SubmitField('Sort')
class BaidutongjiForm(Form): token = StringField(u'健值') status = SelectField(u'状态', choices=[(u'True', u'启用'), (u'False', u'停用')]) submit = SubmitField(u'提交')
raise ValidationError(u'邮箱已被注册!') class ChangePasswordForm(Form): old_password = PasswordField(u'旧密码', validators=[DataRequired()]) password = PasswordField(u'密码', validators=[DataRequired(), EqualTo(u'password2', message=u'密码必须一致!')]) password2 = PasswordField(u'重输密码', validators=[DataRequired()]) submit = SubmitField(u'更新密码') class AddUserForm(Form): username = StringField(u'用户名', validators=[DataRequired(), Length(1, 64, message=u'姓名长度要在1和64之间'), Regexp(ur'^[\u4E00-\u9FFF]+$', flags=0, message=u'用户名必须为中文')]) email = StringField(u'邮箱', validators=[DataRequired(), Length(6, 64, message=u'邮件长度要在6和64之间'), Email(message=u'邮件格式不正确!')]) role = SelectField(u'权限', choices=[(u'True', u'管理员'), (u'False', u'一般用户') ]) status = SelectField(u'状态', choices=[(u'True', u'正常'), (u'False', u'注销') ]) submit = SubmitField(u'添加用户') def validate_username(self, field): if User.query.filter_by(username=field.data).first(): raise ValidationError(u'用户名已被注册!') def validate_email(self, field): if User.query.filter_by(email=field.data).first(): raise ValidationError(u'邮箱已被注册!') class DeleteUserForm(Form): user_id = StringField()
class CreateUserForm(Form): firstName = StringField("First Name", [validators.Length(min=1, max=150), validators.DataRequired()]) lastName = StringField("Last Name", [validators.Length(min=1, max=150), validators.DataRequired()]) membership = RadioField("Membership", choices=[("F", "Fellow"), ("S", "Senior"), ("P", "Professional")], default="F") gender = SelectField("Gender", choices=[("", "Select"), ("M", "Male"), ("F", "Female")], default="") remarks = TextAreaField("Remarks", [validators.Optional()])
class ViewSelectForm(Form): #newarr is a list that has multiple tuples which store the (value, *name displayed on the dropdown*) newarr = [('MajorInfo', 'Major Information'), ('ProteinManu_Protein', 'Dense Protein Food Manufacturers'),('HeavyProtein_protein', 'Heavy Protein Food'),('FoodManufacturers', 'Food Manufacturers'),('HeavyProtein_LowCarb', 'Heavy Protein and Carbs Food'),('AverageRatings', 'Average Ratings'),('HighlyRated', 'Highly Rated Food'),('CommonNutrients', 'Common Nutrients'),('MostReviewed', 'Most Reviewed'),('RecentReviews', 'Recent Reviews')] #SelectField is a class so we're defining name as an object of the SelectField class which helps us create dropdowns in the html document name = SelectField(coerce=str, choices = newarr)
Distance=[('nie dotyczy','nie dotyczy'),('Mniej niż miesiąc','Mniej niż miesiąc'),('Miesiąc','Miesiąc'),('Dwa miesiące','Dwa miesiące'),('Trzy miesiące','Trzy miesiące'),('Cztery miesiące','Cztery miesiące'),('Pół roku','Pół roku'),('Rok','Rok'),('Ponad rok','Ponad rok')] Praw = [('0.3','0.3'), ('0,4','0,4')] class UsersSearchForm(Form): choices = [('', ''),('', '')] select = SelectField('',choices=choices) search = StringField('') class ProjectForm(Form): wiek_matki = SelectField('1.Wiek matki podczas zajścia w ciążę', choices=Age) wiek_ojca= SelectField ('2.Wiek ojca w czasie prokreacji',choices=Age) krotka_szyja = BooleanField('') male_hypoplastyczne_malzowiny_uszne = BooleanField('') plaska_twarz = BooleanField('') krotkie_dlonie = BooleanField('') skosno_ustawione_powieki = BooleanField('') opozniony_rozwoj = BooleanField('') wady_serca = BooleanField('') wady_sluchu = BooleanField('') wady_wzroku = BooleanField('') obnizona_odpornosc = BooleanField('') ilosc_dzieci_w_rodzinie = SelectField('4.Liczba dzieci urodzonych przez matkę', choices=NumberOfChildren) wystepowanie= RadioField ('5.Czy choroba wystepowała w rodzinie?', choices=RadioYesNot) kontakt_z_prom = RadioField ('6.Kontakt matki z promieniowaniem', choices=RadioYesNot) kontakt_z_sub = RadioField ('7.Kontakt matki ze szkodliwymi substancjami', choices=RadioYesNot) leki=RadioField('8.Czy zażywano silne leki,np.na trądzik(izotek)', choices=RadioYesNot) ciaza = RadioField('9.Czy zajście w ciążę nastąpiło podczas kuracji?', choices=RadioYesNotOr) odstep = SelectField('10.Odstęp między zakończeniem kuracji a zajściem w ciążę', choices=Distance)
class SearchForm(FlaskForm): blood_group = SelectField('Search by Blood Group: ', choices=[('All','All'),('A+','A+' ), ('A-', 'A-'), ('B+', 'B+'),('B-', 'B-'),('O+', 'O+'), ('O+', 'O-'), ('AB+', 'AB+'), ('AB-', 'AB-')],validators = [DataRequired()]) Submit = SubmitField('Search')
class UsersSearchForm(Form): choices = [('', ''),('', '')] select = SelectField('',choices=choices) search = StringField('')
class Search(Form): search_by = SelectField('Recherche Par/ Search By', choices=[('first_name', 'Prenom/First Name'), ('last_name', 'Nom/Last Name')]) search_term = StringField('Search Term') submit = SubmitField('Chercher/Search')
class TimerCheckForm(BaseCheckForm): ''' Class that creates an timer form for the dashboard ''' timer = SelectField( "Interval", validators=[DataRequired(message="Interval is a required field")])
class CustomizeStatsForm(FlaskForm): organization = SelectField("Select Office", coerce=int) submit = SubmitField("Submit")
class EconomyForm(FlaskForm): tax = SelectField('Tax', coerce=int) rations = SelectField('Rations', coerce=float)
class updateRatingForm(FlaskForm): score = SelectField('Score', choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10)], validators=[DataRequired()]) submit = SubmitField('Update Rating')
class TodoForm(FlaskForm): title = StringField('Title', validators=[InputRequired(), Length(max=50)], render_kw={"placeholder": "Create a new task"}) description = StringField('Description', validators=[InputRequired(), Length(max=200)]) priority = SelectField('Priority', choices=[('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5')]) deadline = DateField('Deadline', format='%m/%d/%Y', render_kw={"placeholder": "MM/DD/YYYY"})
class ChannelForm(FlaskForm): channel=SelectField('Channel to start', choices=[(c['code'],c['name']+' ('+c['stream']+')') for c in Config.CHANNELS ]) submit=SubmitField('Start')
class AddCompanyJobApplicationForm(FlaskForm): date_posted = DateField( "Date Posted: ", [validators.optional()], render_kw={'placeholder': "YYYY-MM-DD. The date that this job advert was posted."}, ) job_role = StringField( "Job Role / Position: ", validators=[InputRequired(message="Which job role have you applied for?")], render_kw={'placeholder': "The job role you're applying for."}, ) emp_type = SelectField( "Employment Type: ", choices=[ ("full_time", "Full Time"), ("part_time", "Part Time"), ("temp", "Temporary"), ("contract", "Contract"), ("other_emp_type", "Other") ], default="full_time") job_ref = StringField( "Job Reference: ", [validators.optional()], render_kw={'placeholder': "A reference for this job if provided."}, ) job_description = TextAreaField( "Job Description: ", [validators.optional()], render_kw={'placeholder': "All info provided regarding the job role itself."}, description="You can copy in all the text provided regarding the role itself here." ) job_perks = TextAreaField( "Job perks: ", [validators.optional()], render_kw={'placeholder': "Job perks / benefits mentioned in the job posting."}, description="What are they offering you in the job post?", ) tech_stack = TextAreaField( "Tech Stack: ", [validators.optional()], render_kw={'placeholder': "The technologies you'll be working with in this role, if mentioned."}, description="The technologies you'll be working with in this role.", ) salary = StringField( "Salary/Rates: ", [validators.optional()], render_kw={'placeholder': "Annual/monthly/hourly Salary/Wages. "}, description="If the job post provides the annual salary / hourly rate, it can go here.", ) platform = StringField( "Job platform / board: ", [validators.optional()], render_kw={'placeholder': "The platform / site / job board where you found this job posting."}, description="Job platform / board where you found this role, if applicable.", ) job_url = URLField( "Job URL: ", [validators.optional()], render_kw={'placeholder': "The website link for the platform / job board where you found this job posting."}, description="Where (website) did you find this job post?", default="http://...", ) user_notes = TextAreaField( "Your notes: ", [validators.optional()], render_kw={'placeholder': "Your own notes / data from the job spec."}, description="You can add your own notes or just use this to copy in content from the job post.", ) save_button = SubmitField("Save")
class RegistrationForm(FlaskForm): username = StringField('Username', validators=[InputRequired(message="Username required"), Length(min=4, max=25, message="Username must be between 4 and 25 characters")]) password = PasswordField('password', validators=[InputRequired(message="Password required"), Length(min=8, max=15, message="Password must be between 8 and 15 characters")]) role_id = SelectField("Role",choices=[('executive','Executive'),('cashier','Cashier')],default='select role')
class Ratingform(Form): name = SelectField()
def __init__(self, *args, **kwargs): kwargs['coerce'] = int self.fmt = kwargs.pop('fmt', str) self.values = kwargs.pop('values', []) SelectField.__init__(self, *args, **kwargs)
class MainForm(FlaskForm): hostname = StringField(label='Hostname', validators=[DataRequired()]) database_type = SelectField(label='Database Type', choices=[('mysql', 'MySQL'), ('postgres', 'PostgresSQL')]) username = StringField(label='Username', validators=[DataRequired()]) password = PasswordField(label='Password', validators=[DataRequired()]) submit = SubmitField(label='Submit')