Example #1
0
def stocks():
    global reverse
    sortby = request.args.get('sortby') if request.args.get('sortby') else "_id"
    prices = Log.prices()
    prices.sort(key=operator.attrgetter(sortby), reverse=reverse)
    reverse = not reverse
    return render_template('update.html', prices=prices)
Example #2
0
def delete(stock):
    Log.delete_price(stock)
    return render_template('update.html', prices=Log.prices())
Example #3
0
def yahoo(stock, symbol):
    print(stock, symbol)
    Price.get(stock).update({'yahoo': symbol})
    return render_template('update.html', prices=Log.prices())