saving now works, remove exports completely
This commit is contained in:
10
main.py
10
main.py
@@ -1,7 +1,7 @@
|
||||
# main.py
|
||||
from flask import Flask, render_template, request, redirect, url_for, Response
|
||||
from flask import Flask, render_template, request, redirect, url_for, Response, jsonify
|
||||
from calc import calculate_savings_depletion
|
||||
from db import init_db, get_finance_data, update_finance, get_budget_data, get_comp_set_data, get_comp_set_options
|
||||
from db import init_db, get_finance_data, update_finance, get_budget_data, insert_cset, get_comp_set_data, get_comp_set_options
|
||||
from collections import defaultdict
|
||||
from datetime import datetime
|
||||
import csv
|
||||
@@ -10,6 +10,9 @@ from disp import FP_VAR
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
# core vars that we will save for comparisons
|
||||
VARS= ( 'D_Salary', 'D_Num_fortnights_pay', 'School_Fees', 'Car_loan_via_pay', 'Car_loan', 'Car_balloon', 'Living_Expenses', 'Savings', 'Interest_Rate', 'Inflation', 'Mich_present', 'Overseas_trip', 'Mark_reno', 'D_leave_owed_in_days', 'D_TLS_shares', 'M_TLS_shares', 'D_CBA_shares', 'TLS_price', 'CBA_price', 'Overseas_trip_date', 'Mark_reno_date', 'Sell_shares', 'CBA', 'TLS' )
|
||||
|
||||
# Initialize the database
|
||||
init_db()
|
||||
|
||||
@@ -74,8 +77,7 @@ def index():
|
||||
|
||||
@app.route('/save', methods=['POST'])
|
||||
def save():
|
||||
for el in request.form:
|
||||
print(f"SAVE: {el}={request.form[el]}")
|
||||
insert_cset( request.get_json() )
|
||||
return "200"
|
||||
|
||||
@app.route('/update', methods=['POST'])
|
||||
|
||||
Reference in New Issue
Block a user