mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 19:04:18 +00:00
18 lines
481 B
Python
18 lines
481 B
Python
from flask import request, url_for
|
|
from app.models import Corpus
|
|
|
|
|
|
def corpus_endpoint_arguments_constructor():
|
|
return {'corpus_id': request.view_args['corpus_id']}
|
|
|
|
|
|
def corpus_dynamic_list_constructor():
|
|
corpus_id = request.view_args['corpus_id']
|
|
corpus = Corpus.query.get_or_404(corpus_id)
|
|
return [
|
|
{
|
|
'text': f'<i class="material-icons left">book</i>{corpus.title}',
|
|
'url': url_for('.corpus', corpus_id=corpus_id)
|
|
}
|
|
]
|