re-vamp of front-end to use less space. Also, first pass at using comparison data from DB, and created a function to find the last comparison value and use that in the table
This commit is contained in:
11
main.py
11
main.py
@@ -1,7 +1,7 @@
|
||||
# main.py
|
||||
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
|
||||
from db import init_db, get_finance_data, update_finance, get_budget_data, last_cset_savings_data
|
||||
from collections import defaultdict
|
||||
from datetime import datetime
|
||||
import csv
|
||||
@@ -20,12 +20,13 @@ def index():
|
||||
if depletion_date:
|
||||
depletion_date=depletion_date.date(); # just show date
|
||||
|
||||
# HARDCODED FOR NOW
|
||||
cset_id = 1
|
||||
# work out comparison func, but hardcode for now:
|
||||
COMP={}
|
||||
# COMP['date']='2025-02-05'
|
||||
# COMP['amount']=414887
|
||||
COMP['date']='2031-04-09'
|
||||
COMP['amount']=4273.14
|
||||
COMP['date'], COMP['amount'] = last_cset_savings_data( cset_id )
|
||||
COMP['vars']=finance_data
|
||||
COMP['savings_data']=savings_per_fortnight
|
||||
|
||||
return render_template('index.html', finance=finance_data, depletion_date=depletion_date, savings=savings_per_fortnight, TLS=TLS, CBA=CBA, BUDGET=BUDGET, COMP=COMP)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user