Esempio n. 1
0
def background_process():

    try:
        notes = request.args.get('notes')
        if notes == '':
            return jsonify(result='')
        results = functions.get_search_data(str(notes), session['id'])
        temp = ''
        for result in results:
            temp += "<h4><a href='/notes/" + str(result[0]) + "/'>" + result[1] + "</a></h4><br>"
        return jsonify(result=Markup(temp))
    except Exception as e:
        return str(e)
Esempio n. 2
0
def background_process():
    '''
        App for handling AJAX request for searching notes
    '''
    try:
        notes = request.args.get('notes')
        if notes == '':
            return jsonify(result='')
        results = functions.get_search_data(str(notes), session['id'])
        temp = ''
        for i in range(len(results)):
            temp += "<h4><a href='/notes/" + str(results[i][0]) + "/'>" + results[i][1] + "</a></h4><br>"
        return jsonify(result=Markup(temp))
    except Exception as e:
        return str(e)
Esempio n. 3
0
def background_process():
    '''
        App for handling AJAX request for searching tasks
    '''
    try:
        tasks = request.args.get('tasks')
        if tasks == '':
            return jsonify(result='')
        results = functions.get_search_data(str(tasks), session['id'])
        temp = ''
        for result in results:
            temp += "<h4><a href='/tasks/" + str(
                result[0]) + "/'>" + result[1] + "</a></h4><br>"
        return jsonify(result=Markup(temp))
    except Exception as e:
        return str(e)