Questions tagged [finance]
The finance tag has no usage guidance.
510
questions
0
votes
0
answers
11
views
What does 'NoneType' error mean?
In finance, I am getting the following error:
sending POST request to /register
exception raised in application: TypeError: expected string or bytes-like object, got 'NoneType'
Is this related to the ...
0
votes
1
answer
28
views
Could someone take a look at my finance index? I'm going round in circles and can't find the problem. Everything appears as it should when I test
It's failing on check50
:( buy handles valid purchase
expected to find "112.00" in page, but it wasn't found
it passes all the check50 tests beforehand, and can't check any of the other ...
0
votes
0
answers
19
views
Finance question. expected status code 200, but got 400 for register route
@app.route("/register", methods=["GET", "POST"])
def register():
"""Register user"""
if request.method == "POST" :
...
0
votes
1
answer
54
views
Finance pset, cs50's SQL INSERT statements results in runtime error
I'm trying to write a buy() function which would update user's stocks and his balance.
I've added two new tables to my finance.db: stocks table for storing user's stocks and transactions table for ...
0
votes
1
answer
36
views
Check50 marks my "Quote" as if not functioning properly despite looking identical to the staffs solution
I thought I had finished pset9 and had check50 have a quick look at it and it repeatedly gave me the output:
:( quote handles valid ticker symbol expected to find "28.00" in page, but it ...
0
votes
0
answers
47
views
tried everything but pset9 finance last check still wont pass even with the usd formatter?
ive tried for so many hours to get this to work and rewrote the code so many times. i think my tired eyes are missing something obvious but i cant figure it out because the website works when i ...
0
votes
0
answers
8
views
Finance flask unexpectedly closed the connection
hey I'm having an issue with flask run it's been working for about a week and now when I click on it I get the error message: this site can't be reached longurl.dev unexpectedly closed the connection. ...
3
votes
0
answers
84
views
I got an error in check50 but my application runs fine
ObjectNotExecutableError: Not an executable object: 'SELECT 1'
File "/usr/local/lib/python3.11/site-packages/check50/runner.py", line 148, in wrapper
state = check(*args)
^^^^^^^^^^^^
File &...
0
votes
1
answer
49
views
CS50 Week 9 - Finance: How do I save the date and time with SQL?
I'm trying to make a new column in my database where I can save the date and time of the purchase. Am I using the datetime function(?)
ALTER TABLE purchases ADD timedate DATETIME NOT NULL DEFAULT ...
0
votes
1
answer
97
views
I just submitted finance and tested my code for all test cases, upon submission I got 25%
I chose to implement finance using AJAX to challenge myself and my code works. No errors under any circumstance but upon submission, I got 25% because the check50 program was looking for error codes ...
2
votes
1
answer
65
views
PSET9 keeps returning no results
I am trying to submit my pset9 Finance problem but I keep getting "no results" even though my tests checking accordingly. What could be the issue
0
votes
0
answers
25
views
Problem 9: Finance - flask run error
When I enter flask run in the command line it appears to give the normal response but when I click on the link provided in the terminal, it opens a page in firefox titled:
"problem loading page&...
0
votes
1
answer
108
views
:( logging in as registered user succceeds Problem Set 9 Finance TypeError
I can't find the problem with my register function.
So, I've been pouring over the code for hours now, tried taking breaks, focusing for a long time, none of it worked. And check50 is really ...
1
vote
1
answer
535
views
CS50 Finance (week 9 problem set) Check 50 Fails despite program working fine, please help
My program works perfectly when I test it on my own, but when I run check50 it encounters an issue with the "buy" page. The error is """exception raised in application: ...
0
votes
1
answer
68
views
CS50x Pset9 - Finance - checking that "112.00" is in page - buy handles valid purchase
I've tried everything I can think of but I just cant figure out what I'm doing wrong.
I've got all the index values, and all other values for that matter, showing in USD.
I have a catch in the py.app ...
0
votes
1
answer
39
views
CS50 pset9: Why does 'SELECT last_insert_rowid()' return 0 instead of the expected value when using CS50 SQL library in Flask?
symbol_id = db.execute("SELECT symbol_id FROM symbols WHERE symbol = ?", quote["symbol"])
if not symbol_id:
db.execute("INSERT INTO symbols (symbol) VALUES ...
0
votes
1
answer
77
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
75
views
Is there something wrong with my code for finance?
From app.py:
@app.route("/quote", methods=["GET", "POST"])
@login_required
def quote():
"""Get stock quote."""
if request.method == &...
0
votes
0
answers
10
views
Error on importing function from __init__
I have a function create_app in init.py which initiates the app. When I try to import it in app.py check50 throws an error (all files are in the same directory):
:) app.py exists
:| application starts ...
1
vote
0
answers
55
views
buy handles valid purchase expected to find "112.00" in page, but it wasn't found
What am I missing?? from other posts I have read this error typically results from formatting issues. I believe in my code the place to use USD() is on the index page, but it's not resolving the error....
0
votes
0
answers
53
views
quote handles valid ticker symbol: expected status code 200, but got 400
Do you know how to resolve the error of getting status code 400 when a valid ticker symbol is entered on the quote page?
I tried using valid symbols but am only getting status code 200 as expected...
@...
0
votes
0
answers
91
views
Pset9 Check50: buy handles valid purchase
I'm almost done with Finance but my solution doesn't pass the last tests of Check50. I'm stuck on the buy function. Check50 outputs the following: "buy handles valid purchase expected to find &...
0
votes
1
answer
281
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
67
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
161
views
Pset 9 Finance 'TypeError: 'NoneType' object is not subscriptable'
I'm currently doing Finance, for CS50x 2023, but I keep getting the same 'nonetype' object is not subscriptable error. I have tried to debug the error and found out that it is the user_id variable ...
0
votes
1
answer
298
views
expected to find "112.00" in page, but it wasn't found on PSET 9 - FINANCE
it is my first time asking here as I've tried various methods and solutions but still unable to solve this problem. I always get stuck on "buy handles valid purchase - expected to find "112....
0
votes
1
answer
108
views
What does "submit the user’s input via POST to /register" mean?
I'm doing "Finance" from Week 9. In register implementation, says:
Submit the user’s input via POST to /register.
I researched, but I can't understand what does that mean. I inserted the ...
1
vote
1
answer
253
views
PSET9 Finance - Lookup function returns 402
I have been trouble shooting this for a while now. I have the Quote page working and I verified the stock symbol is being sent over correctly to the lookup function. I have done the export API_Key ...
0
votes
1
answer
358
views
PSET 9 Finance Index Function (jinja2.exceptions.UndefinedError: 'row' is undefined)
I have tried using dot notation in the index.html for loop. I referred to Lab 9 to check my syntax and ensure that I am passing variables correctly from app.py. I have also used flash(stock_rows[0][&...
0
votes
1
answer
90
views
CS50 PS9 finance :( buy exception raised in application: TypeError: '<' not supported between instances of 'str' and 'float'
@app.route("/buy", methods=["GET", "POST"])
@login_required
def buy():
"""Buy shares of stock"""
if request.method == "GET":
...
0
votes
0
answers
17
views
Finance Pset trouble matching username in login function
still working on the Finance PSET here. I'm running into a problem where I'm not able to log in because the username is not recognized (even if the username exists). Here is my code for the login ...
0
votes
1
answer
77
views
Runtime error with Buy function
UPDATED:
I've cleared up the runtime error caused by this code, so now it runs but it doesn't work correctly. I just get an apology back even if I submit a valid stock symbol and number of shares and ...
0
votes
1
answer
41
views
Pset9 Register function not working
Working through Pset9 and every time I try testing my register function I get back an image of a grumpy cat and a 403: Invalid username and/or password message.
This is my code for the register ...
0
votes
0
answers
36
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
44
views
CS50 Problem set 9 - Finance - RuntimeError: foreign key mismatch - "holdings" referencing "users"
I'm facing a Runtime Error in /buy when I try to insert information about the stock into the holdings table. Here is my code for /buy:
# Update holdings table
db.execute("INSERT ...
0
votes
1
answer
144
views
check cs50 pset9 finance buy and sell errors
:( buy handles fractional, negative, and non-numeric shares
expected status code 400, but got 200
:( buy handles valid purchase
expected to find "112.00" in page, but it wasn't found
:| sell ...
0
votes
2
answers
170
views
CS50 Finance: Can't add time of transaction
I have managed to complete the rest of the history part except the time of transaction.
I have tried several different ways to solve this problem, using data types like "DATETIME" or "...
0
votes
0
answers
480
views
PSET9 finance 'buy handles valid purchase error, expected to find "112.00" in page, but it wasn't found'
I'm having issues figuring out why i'm running into this error. I've tried looking online and seeing what answers I could find but I'm stuck. Any help would be greatly appreciated.
Error is:
:( buy ...
0
votes
1
answer
511
views
Check50 is broken on Problem set 9 (Finance)
I made a previous very advanced version of Finance. But after checking it with check50, almost every checks failed. I decided to throw it all away and make a very scholar version of it, making ...
0
votes
1
answer
102
views
check50 Finance "can't check until a frown turns upside down"
I have tested the code manually and everything works fine
app.py:
import os
from cs50 import SQL
from flask import Flask, flash, redirect, render_template, request, session
from flask_session import ...
0
votes
1
answer
101
views
CS50 Finance check50 giving 400 error despite working well
I have coded the CS50 Finance problem set and it seems to be working fine from my end. However, check50 throws a 400 error for Post request on /register. Even in the console, I don't see that error.
...
0
votes
1
answer
165
views
Finance index.html is not displaying any data at all
I am stuck on index() in finance. I have a working SQL function which compiles all the transactions made by the user and sums the shares of all the repeating stocks - ie creating a list of owned ...
0
votes
1
answer
8
views
Finance - Quote: Toggle visibility between submit button and table
I'm happy that my finance website finally works properly!!!
The thing is that I'm trying to make it look like the staff's solution website and I can't seem to get quote.html to behave like theirs (...
0
votes
1
answer
513
views
CS50 Finance ValueError: FOREIGN KEY constraint failed
this error has getting me for a while now. From what I researched, it commonly occurs when inserting a wrong type in a column field or a value in the wrong order. Even though it appears in check50, I ...
0
votes
0
answers
30
views
Finance Index: Lookup won't accept subscripted argument
I'm working on index in finance. This is my code:
@app.route("/")
@login_required
def index():
id = session["user_id"]
stocks = db.execute("SELECT symbol, SUM(shares) ...
0
votes
0
answers
646
views
Help wanted. Trying to make a table using a loop in jinja
My name is Sol and I'm kinda new here.
I'm trying to finish my CS50 PSET 7 and I got stuck.
Both in index.html and history.html I have the same problem. I'm trying to populate a table with info taken ...
0
votes
0
answers
92
views
pset9 Finance Check50 bot says submission button not found
I have completed my application for pset9 and have all functions working properly, however check50 doesn't agree with my register implementation. Apparently, I do not have a submission button, however ...
0
votes
1
answer
74
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.
@...
1
vote
1
answer
190
views
cs50 finance - RuntimeError: unsupported value: <function buy at 0x7f1c380cfd90>
@app.route("/buy", methods=["GET", "POST"])
@login_required
def buy():
"""Buy shares of stock"""
if request.method == "POST":
...
0
votes
0
answers
1k
views
Here is my cs50 finance /buy code
@app.route("/buy", methods=["GET", "POST"])
@login_required
def buy():
"""Buy shares of stock"""
if request.method == "POST":
...