Esempio n. 1
0
def sharedata():
    js = share_data.getalljsonshares(current_user.username)
    io = StringIO()
    #return json.dumps(js, io)
    data= json.dumps(js, io)

    if current_user.is_authenticated:

        return render_template('sharedata.html', data=share_data.getalljsonshares(current_user.username),
                               portfolioids=Userownedshare.listportfolios())
Esempio n. 2
0
def index():

    if current_user.is_authenticated:



        return render_template('index.html', shares=share_data.getalljsonshares(current_user.username), portfolioids = Userownedshare.listportfolios())

    else: return render_template('index.html')
Esempio n. 3
0
def list_portfolio(portfolio_id):

    allshares = share_data.getalljsonshares(current_user.username)
    sharesinportfolio = []

    for share in allshares:

        if share['portfolioid'] == portfolio_id:

            sharesinportfolio.append(share)


    return render_template('portfolio.html', id=portfolio_id, portfolioids = Userownedshare.listportfolios(), portfolioshares=sharesinportfolio)