Ejemplo n.º 1
0
def search():
    searched_phrase = str(request.form['searched_phrase'])
    filtered_questions = data_manager.search(searched_phrase)
    filtered_answers = data_manager.search_answer(searched_phrase)
    return render_template("search_result.html",
                           questions=filtered_questions,
                           answers=filtered_answers)
Ejemplo n.º 2
0
def route_search():
    limit = False
    search_mode = True
    search_text = request.args.get('q')
    question_data = data_manager.search(search_text)
    return render_template("list.html",
                           question_data=question_data,
                           search_mode=search_mode,
                           limit=limit)
Ejemplo n.º 3
0
def search():
    try:
        userid = data_manager.get_user_id(session['username'])
    except KeyError:
        userid = ''
    search = '%' + request.args.get('search') + '%'
    questions = data_manager.search(search)
    return render_template('main.html',
                           questions=questions,
                           search=search,
                           user_id=userid)
Ejemplo n.º 4
0
def search():
    user_id = data_manager.get_userid_by_username(session.get('username'))
    search_phrase = request.form['search_phrase']
    headers = data_manager.get_column_names_of_table(data_manager.question_db)
    questions = data_manager.search(search_phrase)
    answers = data_manager.search_answers(search_phrase)
    return render_template('search_results_head.html',
                           questions=questions,
                           answers=answers,
                           headers=headers,
                           search_phrase=search_phrase,
                           user_id=user_id)
Ejemplo n.º 5
0
def search():
    phrase = request.args.get('search_text')
    if phrase == '':
        flash('Insert letters')
        return redirect(request.referrer)
    else:
        search_text = data_manager.search(phrase)
        answers = data_manager.get_answer()
    return render_template('search.html',
                           search_text=search_text,
                           phrase=phrase,
                           answers=answers)
Ejemplo n.º 6
0
def search_phrase():
    if request.method == 'POST':
        search_phrase = request.form['search_phrase']
        search_question = data_manager.search(search_phrase)
        answers = answers_data.get_all_answers()
    return render_template("search_questions.html",
                           headers=QUESTIONS_HEADERS,
                           headers_print=HEADERS_PRINT,
                           questions=search_question,
                           search_phrase=search_phrase,
                           re=re,
                           answers=answers)
Ejemplo n.º 7
0
def search():
    search_result = data_manager.search(*request.args.values())
    return render_template('search.html', search_result=search_result)
Ejemplo n.º 8
0
def search():
    search_data = request.form.to_dict()
    result = data_manager.search(search_data['query'])
    return render_template('search_result.html', result=result)
Ejemplo n.º 9
0
def search():
    search_phrase = request.args.get('phrase')
    questions = data_manager.search(search_phrase)
    return render_template('index.html', questions=questions)
Ejemplo n.º 10
0
def search():
    search_phrase = request.args.get('search_phrase')
    results = data_manager.search(search_phrase)
    return render_template('search.html',
                           results=results,
                           search_phrase=search_phrase)