Beispiel #1
0
def get_image(id):
    loan = Loan.get_client_loan(Loan, id)
    file_path = os.path.join("./application/static", loan.collaterals[0].image)
    abs_path = os.path.abspath(os.path.dirname(__file__))
    path = abs_path.replace("/views/Loan", "/static")

    return send_file(path + "/" + loan.collaterals[0].image,
                     mimetype='image/*')
Beispiel #2
0
def view_letter(id):
    loan = Loan.get_client_loan(Loan, id)
    file_path = os.path.join("./application/static", loan.G_LC_letter)
    abs_path = os.path.abspath(os.path.dirname(__file__))
    path = abs_path.replace("/views/Loan", "/static")

    print(loan.G_LC_letter)

    return send_file(path + "/" + loan.G_LC_letter, mimetype='application/pdf')
Beispiel #3
0
def get_file(filename, id):
    loan = Loan.get_client_loan(Loan, id)
    for file in loan.collaterals[0].files:
        if file.filename == filename:
            file_path = os.path.join("./application/static", file.filename)
            abs_path = os.path.abspath(os.path.dirname(__file__))
            path = abs_path.replace("/views/Loan", "/static")
            return send_file(path + "/" + file.filename,
                             mimetype='application/pdf')