make radio button for min / avg / max growth value be pushed into which_growth in the DB for bill_type row, then also delete estimated bills for that bill_type, and then calling /bills, causes the estimated bills to be filled back in based on the new chosen growth model
This commit is contained in:
8
main.py
8
main.py
@@ -3,7 +3,7 @@ from flask import Flask, render_template, request, redirect, url_for, Response,
|
||||
from calc import calculate_savings_depletion
|
||||
from db import init_db, get_finance_data, update_finance, get_budget_data, insert_cset, get_comp_set_data, get_comp_set_options, get_bill_freqs
|
||||
from db import get_bill_data, new_bill, update_bill_data, delete_bill
|
||||
from db import get_bill_types, insert_bill_type, update_bill_type, delete_bill_type
|
||||
from db import get_bill_types, insert_bill_type, update_bill_type, delete_bill_type, use_growth
|
||||
from bills import process_bill_data
|
||||
from collections import defaultdict, Counter
|
||||
from datetime import datetime
|
||||
@@ -185,6 +185,12 @@ def DeleteBill():
|
||||
delete_bill( data['id'] )
|
||||
return "200"
|
||||
|
||||
@app.route('/usegrowth', methods=['POST'])
|
||||
def UseGrowth():
|
||||
data = request.get_json()
|
||||
use_growth( data['bill_type'], data['which_growth'] )
|
||||
return "200"
|
||||
|
||||
# Main program
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True)
|
||||
|
||||
Reference in New Issue
Block a user