0

I need some help in index and buy. I'll get back to sell after that again as there are some problems in there still.

First, here's a screenshot of my transactions table: https://1drv.ms/i/s!As6LkLqTe7Ps7gndqMRsZ8AEIABa. There are zeroes in there because those were entries that I had to zero out to put all the shares of the same stock for one user in a single row. So now I want to fix buy and index to reflect that.

And my code: buy route: https://pastebin.com/yT1TKV0s index route: https://pastebin.com/Gw64H1ky 'sell` route: https://pastebin.com/ei7qD5cE

I want to make sure that no 0s or duplicates appear on the Portfolio and that the total values of holdings and everything else are actually displayed. That and the stocks the user currently holds should also all be accounted for on the Portfolio (it seems like that wasn't the case the last time I tested it).

So yeah, any help would be greatly appreciated. Thanks in advance.

3
  • I don't like the idea of "transactions" to be changed retroactively. Or better not call it "transaction" then.
    – Blauelf
    Mar 30 '17 at 11:55
  • Well, it's just the table I'm storing the data on who bought, at what price and when. I'm calling it "transactions" because I couldn't come up with anything better. But the specifications say to not make transactions anyway, so it's not really a transaction. Mar 30 '17 at 17:33
  • I tested the code by going to the site and this is what I found (screenshot link): 1drv.ms/i/s!As6LkLqTe7Ps7gv9x9_9zLUEQIda I made change to the index route in application.py, too, but it didn't work as intended. Here's the link again (updated code): pastebin.com/Gw64H1ky Please help if you can. Thanks. Mar 31 '17 at 22:04

You must log in to answer this question.

Browse other questions tagged .