mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
from flask_wtf import FlaskForm
|
|
from flask_wtf.file import FileAllowed, FileRequired
|
|
from wtforms import FileField, SelectField, StringField, SubmitField
|
|
from wtforms.validators import DataRequired, Length
|
|
|
|
|
|
class OCRJobForm(FlaskForm):
|
|
description = StringField(
|
|
'Description',
|
|
validators=[DataRequired(), Length(1, 64)]
|
|
)
|
|
file = FileField(
|
|
'File',
|
|
validators=[
|
|
FileAllowed(['pdf', 'tif', 'tiff']),
|
|
FileRequired()
|
|
]
|
|
)
|
|
language = SelectField(
|
|
'Language',
|
|
choices=[
|
|
('', 'Choose your option'),
|
|
('eng', 'English'),
|
|
('enm', 'English, Middle (1100-1500)'),
|
|
('fra', 'French'),
|
|
('frm', 'French, Middle (ca. 1400-1600)'),
|
|
('deu', 'German'),
|
|
('frk', 'German Fraktur'),
|
|
('ita', 'Italian'),
|
|
('por', 'Portuguese'),
|
|
('spa', 'Spanish; Castilian')
|
|
],
|
|
validators=[DataRequired()]
|
|
)
|
|
submit = SubmitField('Submit')
|