#refresh portfolio stats @app.route('/refresh/<product_table>', methods = ['GET', 'POST']) def row_sums(): all_product_data = product_table.query.all() all_portfolio_data = portfolio_table.query.filter(portfolio_table.portfolio_id == 1) # list to store sums portfolio_table.portfolio_cost_total = [] # go through each row in square for row in product_table: # variable to store row total total = 0 # go through each item in row and add to total for product_table.product_cost_total in row: total += product_table.product_cost_total # append the row's total to the output list portfolio_table.portfolio_cost_total.append(total) # return the output list flash("Portfolio Refresh Success!") return portfolio_table.portfolio_cost_total
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)