Questions tagged [finance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
23 views

Confused at the indexing of the list variable “rows” for example (if len(rows) != 1 or not check_password_hash(rows[0][“hash”])

I have copied a section from "/login" that was provided in distribution code: # Query database for username rows = db.execute("SELECT * FROM users WHERE username = :username", ...
0
votes
1answer
59 views

Finance DepricationWarning on Check50

My code is failing (or at least not parsing properly) when I run check50. :| quote handles valid ticker symbol check50 ran into an error while running checks! DeprecationWarning: Using or importing ...
0
votes
1answer
376 views

Pset8 Finance - request.args.get() is returning None in check()

I've been banging my head on writing check(). My request.args.get() is returning None and therefore unable to query the username in my javascript. Here's a screenshot of my console: I'm expecting: ...
0
votes
1answer
61 views

Pset8 Finance - SELECT is blank

Stock holdings are not printing on my index webpage. "cash" prints correctly. I think the SELECT on my finance.activity table is somehow coming up blank. I am not receiving any errors, and when I ...
0
votes
1answer
92 views

Pset 8 Finance - check50 error

pset8:finance iam tired of trying what now??
0
votes
1answer
90 views

PSet 8, Finance, cannot submit or reset button on register

I keep getting TypeError: document.getElementById(…).submit is not a function when i try and use document.getElementById("mysubmit").submit(); I've searched a lot and the biggest reason is that ...
0
votes
1answer
405 views

unused variable error when trying to create separate table for each user's transactions in finance problem

here is my code 215 db.execute("CREATE TABLE ':username' [finance.db]('symbol' varchar(16),'price' float, 'shares' int,'transaction_date' date , 'transaction_time' time" ,...
0
votes
1answer
208 views

Pset 8 - usd and jinja

How do I use the usd function with jinja? I tried the following: {% for row in rows %} <tr> <td>{{ row.Symbol }}</td> <td>{{ row.Name }}</...
0
votes
1answer
109 views

Why won't DELETE * FROM in sql work? i Guess I could delete each column individually. Further info below

sell application: total_shares = db_shares[0]["shares"] - int(shares) if total_shares == 0: db.execute("DELETE * FROM stock_info WHERE id = :user_id AND stock_symbol = :...
0
votes
1answer
48 views

check50 finance button not found

For pset8 finance check 50 is showing errors stating :( quote page has all required elements expected button to submit form, but none was found The html template and source have a button ...
0
votes
1answer
39 views

When I click on the sell button in sell.html it doesn't do anything. Why is post sell in application not activating?

ide INFO:werkzeug:192.168.112.177 - - [20/Aug/2019 04:55:41] "GET / HTTP/1.0" 302 - INFO:werkzeug:192.168.119.228 - - [20/Aug/2019 04:55:41] "GET /login HTTP/1.0" 200 - INFO:werkzeug:192.168.119.228 ...
0
votes
1answer
670 views

C$50 Finance Buy and Quote not working

When I test my code myself, it seems to work, but check50 is showing otherwise. Quote has a single problem, and buy has two problems, but I am not able to figure out where in the code is the error and ...
0
votes
1answer
394 views

how to make a history table pset8

I can not get a history table to work. I'm confused about how to get each value that needs to be in each row of the table. Here is what I have right now, I just don't understand how to pull each value ...
0
votes
1answer
104 views

In the buy function the variable float(stock_total) will not convert to float. Can someone explain how to fix it? Also what is causing the problem?

@app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): """Buy shares of stock""" if request.method == "POST": symbol = request.form.get("symbol") # get stock ...
0
votes
1answer
458 views

Missing value for placeholder user_id pset8 history

So when I try to make a history table, with some code that looks like purchases = db.execute("SELECT stock, boughtsold, price, shares, time, user_id FROM history WHERE user_id = :user_id") for ...
0
votes
1answer
52 views

Final project (very similar to Finance) : How can I delete selected row of table?

In mynote.html, there is a table of words. It is very similar to history.html or index.html of Finance (pset8). I want to upgrade it for my final project, so I tried to make 'delete'. But, there is a ...
0
votes
1answer
237 views

Pset8 Finance problems with SQLite inserting into a table

Inserting into a table in finance.db fails. I'm able to run the sqlite3 command via cli without errors and populate the table with the debugging snippet command: INSERT INTO history (date, symbol, ...
0
votes
1answer
380 views

I have some code below getting error from session[“user_id”]. What is causing the error?

Here is a link to the code. I am getting an errors in the code no idea how to fix them? Here is the error message * Serving Flask app "application.py" (lazy loading) * Environment: production ...
0
votes
1answer
185 views

pset 8 finance: :( sell handles valid sale

:) Struggle with the last check. Get this error message: expected to find "56.00" in page, but it wasn't found Tried the same approach like I used for the buy-function. Create an extra template to ...
0
votes
1answer
35 views

pset8 New errors without changing any old code [duplicate]

I've been working hard on pset8 lately and making great progress. I was busy and didn't get to work on it for about a week. I'm now getting errors that I didn't get before, and as far as I'm aware, I ...
0
votes
1answer
200 views

pset 8 finance: “:( buy handles valid purchase” fails

I`am bug fixing my application and can't find a solution for the ":( buy handles valid purchase" test. Here is Log: expected to find "112.00" in page, but it wasn't found Log sending POST ...
0
votes
1answer
43 views

I am having trouble correctly rendering bought.html Can someone help? More details below

I am getting an bug in my code. This is caused by From the ide DEBUG:cs50:SELECT id FROM stock_info where id = 108 length of rows {} 1 DEBUG:cs50:SELECT * FROM stock_info where id = 108 length of ...
0
votes
1answer
153 views

Getting an error in my code. Can someone help? My main question is can a select statement return an empty list without having an error?

Here is the code @app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): """Buy shares of stock""" if request.method == "POST": stock = request.form.get("symbol") ...
0
votes
1answer
83 views

Getting an error in register. Can someone help? Better explanation below

I am getting an error in register. Can someone explain why? Here is what the database looks like. Here is the error code. flask run * Serving Flask app "application.py" (lazy loading) * ...
0
votes
1answer
171 views

pset8 finance check50 fails on “checking that ”56.00“ is in page” even though it is in the page

My sell function redirects to index, and I am able to see the correct stock prices and total value amounts formatted as USD, but for some reason check50 won't pass me on the final test (https://cs50....
0
votes
1answer
97 views

pset8 finance: Problem with calculaton for “/sell”

I'm implementing the "sell" function and have a problem with the calculation of the new value for "share" and "cash". Here is my code: @app.route("/sell", methods=["GET", "POST"]) @login_required ...
0
votes
1answer
201 views

Inserting transaction type into SQL database (CS50 Finance)

I am currently encountering an issue where my code won't insert the transaction type into my history database. If I remove transaction from the SQL querry the code works fine. Any ideas what the issue ...
0
votes
1answer
106 views

CS50 finance/sell: DB not updating cash

I am currently working on the finance assignment however I am facing some difficulties updating the cash variable into my users database. All other database updates work fine but when it tries to ...
0
votes
1answer
71 views

Why I can't make one event handler to three elements with its ID? [JQuery]

I want to trigger one function every time that the user types something in one of my desire elements (username, password or confirmation) for that, I try to implement this line of code: //Disabling ...
0
votes
1answer
606 views

CS50 Pset8 Finance /check - TypeError: The view function did not return a valid response

I've got most of finance working but I can't for the life of me sort out /check. No matter what I do, I get the error: 'TypeError: The view function did not return a valid response. The function ...
0
votes
1answer
240 views

Pset8 Finance problem with preventDefault

guys! I have created script in "check" template, but it looks like there is something wrong with conditional part where script should select between proceeding with "submit" and preventDefault. In my ...
0
votes
2answers
352 views

PSET7 : “application raised an exception (see log for details)” Theres a log?

Pset7 works perfectly: db writing , back-end calculations, front-end rendering - you name it. But check50, via cs50.me, complains: Wheres this log ? There's no guidance as to which line, of which ...
0
votes
1answer
345 views

pset7 finance: index not working after register

I have an issue with my index function after a user newly registers. After registering, a new row is created in the table users with a cash value set to 10000 by default. After registering, the user ...
0
votes
1answer
64 views

Foreign key not working

I'm having problems with the use of foreign key: For pset7 - finance I have created a table portfolio, per the following command: CREATE TABLE finance.portfolio (transactionid INTEGER PRIMARY KEY ...
0
votes
1answer
93 views

Pset7 Finance Key Error in Buy

I have some trouble with the insertion into the database table in the buy section. I get a KeyError: "id". This is my code: result = db.execute("INSERT INTO transactions (id, symbol, price, shares, ...
0
votes
1answer
61 views

pset7 C$50 Finance Same expected code 200 error with check50 for register though app work fine

I'm having the same issues I've seen on the forum with check50 returning errors for the register function I've finished the app and it works fine (no errors being returned in the flask terminal, both ...
0
votes
1answer
309 views

PSET7: Finance: check50 errors

I have implemented all pages except the default homepage. Every functionality is working fine. But, check50 shows some errors which never goes. I don't know which frown is turning upside down. Help ...
0
votes
1answer
91 views

Check50 problem with BUY action

I've got another problem with finance, pset7, CS50x. When I check50 my solution, I get an error (see first of image) claiming that a KeyError (on a field named "date_time") occurs when performing a ...
0
votes
1answer
91 views

History, Timezones and Daylight Saving Time

This is a question about pset 7, finance. As I'm just starting with that exercise, I'm not allowed to look at older posts about pset7 or finance at the moment. So if you think this is a duplicate ...
0
votes
1answer
3k views

PSET7 finance index

This is my application.py code @app.route("/") @login_required def index(): """Show portfolio of stocks""" stocks = db.execute("SELECT stock, number FROM portfolio WHERE id = :id", id = ...
0
votes
1answer
62 views

Can't display name of stock PSET7

I finally made some forward progress by myself, and I have all the variable rows filled in, buy the stock and symbol show the same thing, when I would like one to say "AAPL" and the other to say "...
0
votes
1answer
398 views

pset7 finance portfolio table won't update with buy function

Below is my code for buy. After I run flask and tried to make a purchase, the history table updated and cash deducted from users table. However, portfolio table is still empty. I am thinking the error ...
0
votes
2answers
167 views

The predefined login function does not seem to be working in finance

All the registered ids are not able to log in. Even though the username and password are correct the website returns 400 error def login(): """Log user in""" # Forget any user_id session.clear() # ...
0
votes
2answers
287 views

pset7: check50 error - sell page has all required elements

I'm having an argument with check50 on pset7 finance, when it comes to the SELL part. The web app works fine and I'm able to sell my stocks. When I run check50, though, it keeps telling me that the ...
0
votes
1answer
397 views

How can I debug an internal server error in pset 7 to get past login and register?

Whenever I try to login or register after running "flask run" on pset7, I receive an internal server error. When I run check50, it says that registering a user does not succeed and registration does ...
0
votes
1answer
58 views

why can't I even log in now ? pset7

code: def index(): """Show portfolio of stocks""" portfolio_symbols = db.execute("SELECT shares, symbol \ FROM log WHERE id = :id", \ ...
0
votes
1answer
563 views

pset7 Finance quote not returning anything?

I am working on pset7 finance quote and my code isn't displaying anything in the form that returns the data about the stock to the user. I did some research in the forums and it sounds like there was ...
0
votes
1answer
283 views

Pset 7 - CS50 Finance: “Buy” - 500 Internal Server error on INSERT INTO

Right now I'm attempting to insert some information from the user's transaction into my table with this code: # Record transaction db.execute("INSERT INTO trading buyer = :buyer, ticker = :...
0
votes
1answer
365 views

PSET7 Finance Question Quote Lookup Page

I can't seem to get the lookup to work right. I just keep getting an error of "404 Not Found". Here is the URL and it does load but doesn't load when I post to it for some reason http://ide50-...
0
votes
1answer
84 views

PSET7 using jinja and binding variables to output in to HTML

I'm looking to output my db row info though am getting nothing but a blank page instead. Here is my python code which works: @app.route("/") @login_required def index(): """Show portfolio of stocks""...

1 2 3
4
5
9