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:
10
db.py
10
db.py
@@ -278,6 +278,16 @@ def get_bill_types():
|
||||
conn.close()
|
||||
return bt
|
||||
|
||||
def use_growth( bill_type, which_growth ):
|
||||
conn = connect_db(False)
|
||||
cur = conn.cursor()
|
||||
cur.execute( f"update bill_type set which_growth = '{which_growth}' where id = {bill_type}" )
|
||||
# okay, new growth type being used, delete old estimated bills are recreate them
|
||||
cur.execute( f"delete from bill_data where estimated=1 and bill_type = {bill_type}" )
|
||||
conn.commit()
|
||||
conn.close()
|
||||
return
|
||||
|
||||
def get_bill_freqs():
|
||||
conn = connect_db(True)
|
||||
cur = conn.cursor()
|
||||
|
||||
Reference in New Issue
Block a user