1

The error message says RuntimeError: no such column: symbol [SQL: "select shares from stock_info WHERE symbol = 'AAPL' and id = 19"] That does not mean your stock_info table is empty, it is missing the column symbol you are trying to filter on. You need to use columns that exist in your table. If you don't have a column for the share symbol, add it using ...


1

The flask error log (in the console where flask run) should give you all the info you need to troubleshoot and debug. Problem with the first (hover to see spoiler): Problem with the second:


1

It sounds like you're thinking about implementing some of the more complex database concepts that are used in financial programming. Kudos to you! But, these concepts are a little beyond the scope of this class, so they're not really covered or required for these exercises. That's why they're not really supported. Having said that, here are some thoughts ...


1

1)for time stamp you could use this.. from time import gmtime,strftime .... time=strftime("%Y-%m-%d %H:%M:%S", gmtime()) ... output will look like this.. 2017-12-28 09:40:20 now you could set date=time..to get the result 2)for the $ sign ..you may also just print it in the jinja template directly example <td>${{ Price }}<td> ...


1

Here's a way to see what the problem is using command line python: Python 3.4.3 (default, Nov 17 2016, 01:08:31) [GCC 4.8.4] on linux Type "help", "copyright", "credits" or "license" for more information. >>> q="Bowling Green, Florida" >>> q = q.split(",") >>> q I leave it to you to evaluate the result of >>> q to see ...


1

This categories = [amounts[0]["category"]] looks suspicious, since categories is always updated with the first element of amounts. Ditto total_amount.


1

I solved it using this link Challenge inserting into database from buy() as a resource. The problem was with the placement of my quotes I changed db.execute("INSERT INTO transactions (user_id, symbol, stock_price, no_of_shares, total_cost) VALUES (:user_id, :symbol, :stock_price, :no_of_shares, :total_cost), user_id=user_id, symbol=symbol, ...


1

That syntax should work. I suspect that total_stock[0]["SUM(nb_of_shares)"] is 'None' because it did not find any rows that matched username AND stock_symbol. When you use the aggregate function (SUM), this query will always return 1 row. If it hasn't found any rows, all the values will be 'None'.


Only top voted, non community-wiki answers of a minimum length are eligible