Hot answers tagged

3 votes

TypeError: 'NoneType' object is not subscriptable in PSET9, but working manually

I noticed that the issue lies in the line where I insert the stock symbol into the "stocks" table in the buy function. The problem is that I am passing stock["name"] instead of ...
Chris's user avatar
  • 31
2 votes

Week 9 - Finance - Foreign Key Mismatch

It's not what you think. The body of a try block should contain the least amount of code to catch an error. This routine should have one try/except block for each of the executes (and only the execute ...
DinoCoderSaurus's user avatar
1 vote

Week 9 - Finance - Foreign Key Mismatch

Apparently I had a table hidden in my DB somehow. When I run .schema, I saw the following: sqlite> .schema CREATE TABLE users (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username TEXT NOT NULL, ...
Julia 's user avatar
  • 21
1 vote

why does "world" not show up when did not enter name in the form?

From the python docs: get(key[, default]) Return the value for key if key is in the dictionary, else default. If default is not given, it defaults to None, so that this method never raises a KeyError....
DinoCoderSaurus's user avatar
1 vote
Accepted

Lecture 9, how to get default value from `flask.request.get` after submitting a form?

The form method is GET so all parameters are sent in the URL. The python method get finds the key, so does not default to "world". Some ways to change the behaviour: add a test for empty ...
DinoCoderSaurus's user avatar

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