nopaque/app/contributions/tesseract_ocr_pipeline_models/utils.py

14 lines
448 B
Python
Raw Permalink Normal View History

2023-03-14 10:13:35 +00:00
from flask import request, url_for
from app.models import TesseractOCRPipelineModel
def tesseract_ocr_pipeline_model_dlc():
topm_id = request.view_args['tesseract_ocr_pipeline_model_id']
2023-03-14 10:44:15 +00:00
topm = TesseractOCRPipelineModel.query.get_or_404(topm_id)
2023-03-14 10:13:35 +00:00
return [
{
'text': f'{topm.title} {topm.version}',
'url': url_for('.tesseract_ocr_pipeline_model', tesseract_ocr_pipeline_model_id=topm_id)
}
]