forms.py
2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from flask.ext.wtf import Form
from wtforms import StringField, PasswordField, BooleanField, SubmitField, FileField, SelectField
from wtforms.validators import Required, Length, Email
choices = ['train','test']
class LoginForm(Form):
username = StringField('username', validators=[Required(), Length(1, 64)])
password = PasswordField('password', validators=[Required()])
#remember_me = BooleanField('Keep me logged in')
submit = SubmitField('Log In')
class TrainForm(Form):
type_name = SelectField('type', choices = [('train','train'), ('analysis','analysis')])
table_name = StringField('table name', validators = [Required(), Length(1,64)])
img_source = StringField('image directory', validators=[Required(),Length(1,64)])
model_name = StringField('model name', validators=[Required(),Length(1,64)])
label_source = StringField('label file',validators=[Required(),Length(1,64)])
feat_type = StringField('feat type',validators=[Required(),Length(1,64)])
submit = SubmitField('Run')
class ExportDataForm(Form):
type_name = SelectField('type', choices = [('all','all'), ('tagged','tagged')])
table_name = StringField('table name', validators = [Required(), Length(1,64)])
dst_dir = StringField('dentist image directory', validators=[Required(),Length(1,64)])
submit = SubmitField('Run')
class SpiderForm(Form):
spider_source = SelectField('spider source', choices = [('scrapy.cfg.bd','baidu'),('scrapy.cfg.cm','sina')])
table_name = StringField('table name', validators=[Required(),Length(1,64)])
submit = SubmitField('Run')
class JumpForm(Form):
submit = SubmitField('Jump to main')
class JumpSpiderExportForm(Form):
type_name = SelectField('type', choices = [('spider','spider'), ('export','export')])
submit = SubmitField('Jump')
# class TestForm(Form):
# table_name = StringField('table name', validators = [Required(), Length(1,64)])
# img_source = StringField('test directory', validators=[Required(),Length(1,64)])
# model = SelectField('model', choices=list(choices))
# dst_dir = StringField('dst directory', validators=[Required(),Length(1,64)])
# submit = SubmitField('Run')