We changed our privacy policy. Read more.

New answers tagged

0

Datetime module of python does its job correctly but the real issue is of database....Its either problem of squlite3 or cs50's php.....but the value stored in table is "just the date" even if value provided is "both datetime".....I even tried by changing type of "datetime" field to "text" but the problem isn't solved.


0

While it is arguably better UI/UX to validate the input in the html, it does not fulfill the requirements of the buy spec: Require that a user input a number of shares, implemented as a text field whose name is shares. Render an apology if the input is not a positive integer.


1

Since the quote spec calls for an element named "symbol", and this if not request.form.get("stock"): is apparently working, it looks like the element is not named properly in the html. FYI to change "I think" to "I know". ls -al helpers.py (in the finance directory) should return -rw------- 1 ubuntu ubuntu 1748 Apr ...


0

Not sure why it is not working in your code since you are using try but I had kind of similar problem and I fixed it by calling upon isnumeric() method.


1

elif symbol not in rows: will always return True becauserows is a list of dictionaries, and symbol is a string. You could iterate through rows and check the value of each row['symbol'] against symbol. --OR-- Think about how the function would work if this: rows = ("SELECT * FROM portfolio WHERE user_id = ?", session["user_id"]) is ...


0

The name of the database is finance. The name of the (supplied) table is users. This sql db.execute("INSERT INTO finance..... is incorrect. The FROM clause refers to a table or subquery.


Top 50 recent answers are included