converted over to using a class in disp.py that defines data about each variable in the form, and use an array of these objects to format the form in templates/index.html -- provides consistency of bootstrap classes and makes it far easier to move items around columns/rows in the future, e.g. when I resign. Also, now retrieve actual values form comparison set data (still have hardcoded cset_id for now), but also stopped using separate vars for items like CBA/TLS, and buried them into the finance_data
This commit is contained in:
11
calc.py
11
calc.py
@@ -1,6 +1,11 @@
|
||||
# calc.py
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
# this somehow needs to connect the annotation, so maybe store it via date in an annotations array?
|
||||
# not sure I need amount, etc.
|
||||
def add_annotation(label,amount):
|
||||
return
|
||||
|
||||
def calculate_savings_depletion(finance):
|
||||
# Extract all the financial data from the database
|
||||
D_Salary = finance['D_Salary']
|
||||
@@ -174,5 +179,9 @@ def calculate_savings_depletion(finance):
|
||||
current_date += timedelta(days=1)
|
||||
days_count += 1
|
||||
|
||||
return depletion_date, savings_per_fortnight, current_savings, D_TLS_shares+M_TLS_shares, D_CBA_shares
|
||||
finance['CBA']=D_CBA_shares
|
||||
finance['TLS']=D_TLS_shares+M_TLS_shares
|
||||
|
||||
|
||||
return depletion_date, savings_per_fortnight, current_savings
|
||||
|
||||
|
||||
Reference in New Issue
Block a user