Exemple #1
0
def index():
    form = InputForm(request.form)
    if request.method == 'GET':
        return render_template('input.html', form=form)
    elif request.method == 'POST' and form.validate():
        response = run_model_main(form.claim.data, form.document.data)
        data = parse_response(response)
        return render_template('output.html', data=data)
    else:
        return "ERROR NOT SUPPORTED"
Exemple #2
0
def scale():
    form = InputForm(request.form)
    if request.method == 'POST' and form.validate():
        inquiry = form.inquiry.data
        x = 0
        p = 0
        for i in inquiry:
            x += ord(i.lower()) - 96
        y = abs(x) % 10
        if y == 0:
            p = 10
        else:
            p = y
        answer = p
    else:
        answer = None
    return render_template("scale.html", form=form, answer=answer)