예제 #1
0
def other():
    search = TermSearchForm(request.form)
    if request.method == 'POST':
        search_term = search.data['search']
        select_choice = search.data['select']
        by_verse = select_choice == 'By Verses'
        res = make_visualization(search_term, by_verse)
        return redirect(url_for('result', res=res))
    return render_template('other.html', form=search)
예제 #2
0
def result():
    search = TermSearchForm(request.form)
    if request.method == 'POST':
        search_term = search.data['search']
        select_choice = search.data['select']
        by_verse = select_choice == 'By Verses'
        res = make_visualization(search_term, by_verse)
        return redirect(url_for('result', res=res))
    else:
        res = request.args.get('res')
        filename = os.path.join(app.config['UPLOAD_FOLDER'], res)
        return render_template('result.html',
                               form=search,
                               result_graph=filename)