mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 19:04:18 +00:00
29 lines
1.2 KiB
Python
29 lines
1.2 KiB
Python
from flask import request, render_template
|
|
from flask_login import login_required
|
|
from . import corpora
|
|
from .pj_forms import PJDisplayOptionsForm, PJQueryForm, QueryDownloadForm
|
|
from .. import db
|
|
from ..models import Corpus
|
|
|
|
|
|
@corpora.route('/<int:corpus_id>/pj_analyse')
|
|
@login_required
|
|
def pj_analyse_corpus(corpus_id):
|
|
corpus = Corpus.query.get_or_404(corpus_id)
|
|
if corpus.status == 'prepared':
|
|
corpus.status = 'start analysis'
|
|
db.session.commit()
|
|
display_options_form = PJDisplayOptionsForm(
|
|
prefix='display-options-form',
|
|
result_context=request.args.get('context', 20),
|
|
results_per_page=request.args.get('results_per_page', 30))
|
|
query_form = PJQueryForm(prefix='query-form',
|
|
query=request.args.get('query'))
|
|
query_download_form = QueryDownloadForm()
|
|
return render_template('corpora/pj_analyse_corpus.html.j2',
|
|
corpus_id=corpus_id,
|
|
display_options_form=display_options_form,
|
|
query_form=query_form,
|
|
query_download_form=query_download_form,
|
|
title='Corpus analysis')
|