mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-16 01:35:41 +00:00
15 lines
551 B
Python
15 lines
551 B
Python
|
from flask import request, url_for
|
||
|
from app.models import CorpusFile
|
||
|
|
||
|
|
||
|
def corpus_file_dynamic_list_constructor():
|
||
|
corpus_id = request.view_args['corpus_id']
|
||
|
corpus_file_id = request.view_args['corpus_file_id']
|
||
|
corpus_file = CorpusFile.query.filter_by(corpus_id=corpus_id, id=corpus_file_id).first_or_404()
|
||
|
return [
|
||
|
{
|
||
|
'text': f'{corpus_file.author}: {corpus_file.title} ({corpus_file.publishing_year})',
|
||
|
'url': url_for('.corpus_file', corpus_id=corpus_id, corpus_file_id=corpus_file_id)
|
||
|
}
|
||
|
]
|