from flask import request, url_for
from app.models import SpaCyNLPPipelineModel


def spacy_nlp_pipeline_model_dlc():
    snpm_id = request.view_args['spacy_nlp_pipeline_model_id']
    snpm = SpaCyNLPPipelineModel.query.get_or_404(snpm_id)
    return [
        {
            'text': f'{snpm.title} {snpm.version}',
            'url': url_for('.spacy_nlp_pipeline_model', spacy_nlp_pipeline_model_id=snpm_id)
        }
    ]
