All Questions
30 questions
0
votes
1
answer
74
views
Problem with Updated CS50 Finance - all API calls to lookup stocks come back as None
I'm a high school teacher and have been teaching CS50 AP for about 7 years now. I like to make sure that I have a handle on all of the problem sets before going over them with my students. So, when I ...
0
votes
0
answers
65
views
PSet 9 check not working
Evening,
I am getting the following error trying to run check on PSet9. I have downloaded a new empty version tested that and get the same error. I'm thinking this is a fault on the CS50 side but if ...
0
votes
2
answers
120
views
PSet 9 Sell handles valid sale expected to find "56.00" in page
Like others I have become stuck with the above error, although the site seems to display the correct info, any help would be appreciated:
Python Flask Code:
@app.route("/")
@login_required
...
1
vote
2
answers
72
views
Week 9 - Finance - Foreign Key Mismatch
I'm trying to solve this issue for a week and nothing works! in my /buy route, I cannot update the users table with updated cash after a "buy" order is submitted. Here is an example of what ...
0
votes
1
answer
97
views
Check50 PSET9 Finance Failing Throughout
First post here...seems I'm coming unstuck at the pointy end of the course. Hahaha!
My code doesn't seem to be passing Check50 through Quotes/Buy/Sell - although the functionality seems to be fine ...
0
votes
1
answer
340
views
CS50 2023 Finance Check50 issue
There is no way to get rid of the following check50 error:
:( logging in as registered user succeeds
application raised an exception (see the log for more details)
I found through googling that in ...
0
votes
1
answer
82
views
Finance app - object is not subscriptable
I have problems with pset 9 finance.
Since days I try to figure out what is wrong with my code for the sell route.
I know that there a handfull of similar questions on StackExchange/StackOverflow but ...
0
votes
0
answers
55
views
In 'Finance' how do I get the page to load?
I have not been able to get any page to load for the Finance problem (even without me messing about with it!). I tried deleting everything and starting again like so:
$ wget https://cdn.cs50.net/2021/...
0
votes
1
answer
90
views
PSET9 FINANCE SQLITE "no such column exists" while multiplying two columns to update a third
In the Index function on APP.PY of my finance code, I'm getting "RuntimeError: no such column: total_per_share" even though I'm using "AS" to create this column -- please advise.
@...
0
votes
1
answer
202
views
Flask/Python PSET9 Finance -- Using PRINT() to debug
Having some problems with INDEX that I figure printing variable content to console will help me solve. BUT no matter what I try, print(variable) doesn't result in anything at all on the console/...
0
votes
0
answers
129
views
ADD EXTRA CASH IN FINANCE
Trying to add extra cash to my pset finance. I have made as you can see below in the picture, that is adding an extra part of code to the index function(), but I'm just getting a 404 answer. Why is it ...
0
votes
1
answer
280
views
Runtime Error Unsupported Value in pset9 Finance
I'm doing Pset09 "Finance" and I have been stuck in the "index" function for quite a while. I tried to use the already existing "trans" table but I am getting an error. ...
0
votes
0
answers
365
views
What's wrong with my register function? (Pset9 - Finance)
Here's my register function in application.py:
@app.route("/register", methods=["GET", "POST"])
def register():
"""Register user"""
...
0
votes
2
answers
538
views
CS50 IDE gives error for flask run
I was able to run flask run till yesterday. But today it is not working, it has been giving errors for SQL and I have been able to code today. It gives me this error continuously.
ERROR: Error on ...
0
votes
1
answer
188
views
Blocked on C$50 Finance suggested personal touch feature - adapting index page to enable transactions in situ
Dug into the docs and trawled all the usual online sources but starting to suspect that I'm trying to solve this in a way that's impossible!
This is how I've edited the index page to allow user input ...
0
votes
0
answers
765
views
Problem with endblock tag in finance. "endblock" tag unknown
{% extends "layout.html" %}
{% block title %}
Quote
{% endblock %}
{% block main %}
<form action="/quote" method="post">
<div class="form-...
1
vote
2
answers
3k
views
Finance: UNIQUE constraint failed: users.username
I've been struggling with this for days. Ignore the '1234' hardcoded into the "insert into" line, just using that to isolate problems. The problem I'm facing is with the username being ...
0
votes
1
answer
90
views
Internal Error Served if user doesn't own any shares or sell all his shares in Finance
When i sell all the shares i own or even in the case of a new registered user who doesn't own any shares; it doesn't redirect to "/" i.e the main index page but serves me an internal error. It works ...
0
votes
1
answer
45
views
finance: how to build an "active" table
I wish to know how to build a table (in HTML) where the row expand with the row I input on it.
For a static table I've used:
<table style="width:100%">
<tr>
<th>Symbol</...
1
vote
1
answer
1k
views
expected 400 but got 200 OK?
I have implemented Pset-7 (Finance) but check50 shows an error called expected 400 but got 200 in all my apology pages and it is being rejected by check50. Since it successfuly landed to apology page, ...
0
votes
1
answer
513
views
Pset7 Finance, Sell problem with POST requests
My problem is that I'm not getting any value back from my select form. I pass a list of stocks to the jinja template via return render_template("sell.html", stocks=stocks) and on the sell.html page I ...
0
votes
1
answer
233
views
[pset7][Finance-SELL] bootsrap select list to accept symbol(from jinja2 Template) and pass it on to the flask
I was able to create a select list using bootstrap for my 'sell.html':
<div class="form-group">
<select class="form-control","input-group" id="sel1" autocomplete="off" autofocus name="...
0
votes
1
answer
119
views
db.execute() executing only single time
When I enter amount, name, expinc in my html form it works for the first time, i.e. the entered data goes into database tables for the first time but whenever I try to enter data again it doesn't ...
2
votes
2
answers
819
views
Using jinja to render template based on previous url - pset7 finance
For the finance website homepage, I want to render index.html differently based on the previous url. For example, if I logged in I want to render a panel saying 'logged in', but if I registered I want ...
0
votes
1
answer
171
views
Rectify implementation of register function in pset7 - finance (Flask)
def register():
"""Register user."""
if request.method == "POST":
if not request.form.get("username"):
return apology("must provide username")
elif not request....
0
votes
1
answer
68
views
Flask column order randomly changes whenever I refresh local host
Whenever, I hit ctrl + s / close and re-open IDE, and then reload my local page for CS50 finance, I seem to experience a very weird issue of randomly changing column order. This happens without me ...
0
votes
1
answer
84
views
PSet 7: Issues with flask table output - hint needed
I am trying to produce table headings using loop in flash but I get new lines after each:
{% extends "layout.html" %}
{% block title %}
Portfolio overview
{% endblock %}
{% block main %}
{% ...
5
votes
1
answer
4k
views
cs50 finance / pset-7 confused on index() table
I am trying to work on pset7, but am having a problem printing it out to the screen in the table format. I have all the values I need (the values I have are correct), but just can't figure out how to ...
0
votes
1
answer
103
views
pset7: CS50 Finance, ide and flask say syntax is incorrect what am I doing wrong that I don't see?
In the "buy" function of applications.py, no matter what I type, the CS50 IDE and flask both say I have a syntax error in my program. I don't see it and have tried removing parts, checked the syntax ...
0
votes
2
answers
64
views
PS7: Please give me a hint on flask loop usage
Despite reading documentation I cannot figure out why my loop is not functioning properly and is only dynamic for stock symbol? Am I meant to be using multiple nested loops passing all prices, holding ...