mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-12 00:50:40 +00:00
Merge branch 'development' of gitlab.ub.uni-bielefeld.de:sfb1288inf/nopaque into development
This commit is contained in:
@ -42,6 +42,9 @@ class ContributionBaseForm(FlaskForm):
|
||||
'Publishing year',
|
||||
validators=[InputRequired()]
|
||||
)
|
||||
compatible_service_versions = SelectMultipleField(
|
||||
'Compatible service versions'
|
||||
)
|
||||
shared = BooleanField(
|
||||
'Shared'
|
||||
)
|
||||
@ -53,10 +56,7 @@ class CreateTesseractOCRPipelineModelForm(ContributionBaseForm):
|
||||
'File',
|
||||
validators=[FileRequired()]
|
||||
)
|
||||
compatible_service_versions = SelectMultipleField(
|
||||
'Compatible service versions'
|
||||
)
|
||||
|
||||
|
||||
def validate_tesseract_model_file(self, field):
|
||||
current_app.logger.warning(field.data.filename)
|
||||
if not field.data.filename.lower().endswith('.traineddata'):
|
||||
@ -77,9 +77,6 @@ class CreateSpaCyNLPPipelineModelForm(ContributionBaseForm):
|
||||
'File',
|
||||
validators=[FileRequired()]
|
||||
)
|
||||
compatible_service_versions = SelectMultipleField(
|
||||
'Compatible service versions'
|
||||
)
|
||||
pipeline_name = StringField(
|
||||
'Pipeline name',
|
||||
validators=[InputRequired(), Length(max=64)]
|
||||
@ -103,9 +100,15 @@ class CreateSpaCyNLPPipelineModelForm(ContributionBaseForm):
|
||||
class EditContributionBaseForm(ContributionBaseForm):
|
||||
pass
|
||||
|
||||
|
||||
class EditTesseractOCRPipelineModelForm(EditContributionBaseForm):
|
||||
pass
|
||||
def __init__(self, *args, **kwargs):
|
||||
service_manifest = SERVICES['tesseract-ocr-pipeline']
|
||||
super().__init__(*args, **kwargs)
|
||||
self.compatible_service_versions.choices = [('', 'Choose your option')]
|
||||
self.compatible_service_versions.choices += [
|
||||
(x, x) for x in service_manifest['versions'].keys()
|
||||
]
|
||||
self.compatible_service_versions.default = ''
|
||||
|
||||
|
||||
class EditSpaCyNLPPipelineModelForm(EditContributionBaseForm):
|
||||
@ -113,3 +116,11 @@ class EditSpaCyNLPPipelineModelForm(EditContributionBaseForm):
|
||||
'Pipeline name',
|
||||
validators=[InputRequired(), Length(max=64)]
|
||||
)
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
service_manifest = SERVICES['spacy-nlp-pipeline']
|
||||
self.compatible_service_versions.choices = [('', 'Choose your option')]
|
||||
self.compatible_service_versions.choices += [
|
||||
(x, x) for x in service_manifest['versions'].keys()
|
||||
]
|
||||
self.compatible_service_versions.default = ''
|
||||
|
Reference in New Issue
Block a user