Exemplo n.º 1
0
def search_post(request):
    ctx = {}
    if request.POST:
        question = request.POST['query']
        ctx['result'] = query_main.query_function(question)
        print(ctx['result'])
    return render(request, "post.html", ctx)
Exemplo n.º 2
0
def content_post(request):
    ctx = {}
    if request.POST:
        question = request.POST['q']
        ctx['rlt'] = query_main.query_function(question)
        print(ctx['rlt'])
        ctx['q'] = question
        print(ctx['q'])
    return render(request, "con_from_base.html", ctx)
Exemplo n.º 3
0
def search_question(request):
    question = request.GET['q']

    ret = query_main.query_function(question)

    responseData = {
        'code': 0,
        'message': 'ok',
        'data': ret,
    }

    return JsonResponse(responseData)