Questions tagged [finance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
99 views
0
votes
1answer
66 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
471 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: ...
5
votes
3answers
4k views

CS50 Finance/pset8 2019 /check

I am trying to write the script for a form such that if a username is taken, the user is alerted that it is taken, and submission of the form is blocked. If the username then types in the correct ...
0
votes
0answers
134 views

I want to pass on itertools to jinja2 How do I do that? Is that possible? Anther possibility is I join the tables. But I am finding that difficult

Link where I got info from itertools https://stackoverflow.com/questions/44000727/iterate-over-two-lists-with-different-lengths import itertools some of the code in history application. ...
0
votes
1answer
63 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
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
428 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
737 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
226 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 }}</...
1
vote
1answer
78 views

line 541, in sell user_id = current_id coming back as an error, Why? Is it caused by global variables? Thanks

I know my variable names suck. sell application.py @app.route("/sell", methods=["GET", "POST"]) @login_required def sell(): """Sell shares of stock""" current_id = session["user_id_2"] ...
0
votes
1answer
133 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
95 views

PSET8 Finance - Foreign key mismatch - “portfolio” referencing “users”

Working on Pset8, Finance. Created a Foreign Key relationship between my portfolio and users table but getting this error when running the application: foreign key mismatch - "portfolio" referencing "...
0
votes
1answer
73 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
66 views

How do I get the symbol from sell.html in the drop down menu? I tried request.form.get(“symbol”) but get none

...I even tried request.form.get("symbol_list"). sell.html {% extends "layout.html" %} {% block title %} Sell {% endblock title %} {% block main %} <!--https://www.w3schools.com/html/...
0
votes
1answer
41 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
0answers
14 views

in finance I want to go to page if the user clicks a page link. An ex is if I click on sell go to sell else go to sold Is this possible?

in finance I want to go to page if the user clicks a page link. An ex is if I click on sell go to sell else go to sold Is this possible? Thanks for the help.
0
votes
1answer
30 views

db_stock_info in the for loop is not displaying in index.html. I can't figure out why any help appreciated?

index.html {% extends "layout.html" %} {% block title %} index {% endblock title %} {% block main %} <table> <tr> <th> SYMBOL </th> <th> NAME </th>...
0
votes
1answer
66 views

When I type in a random stock symbol for quote…it says internal server error. I did not understand what the error was.Please help

@app.route("/quote", methods=["GET", "POST"]) @login_required def quote(): """Get stock quote.""" if request.method == "POST": if not request.form.get("symbol"): return ...
0
votes
1answer
170 views

I can't seem to fix or find the error in finance. Can someone help? I realize in index.html the if condition needs to be fixed

The code was working before. index function @app.route("/") @login_required def index(): """Show portfolio of stocks""" # User reached route via POST (as by submitting a form via POST) #...
0
votes
1answer
58 views

Finance register function does not insert data in database

I am trying to finish the register function but something goes wrong. I get an error message " It seems that although registration is claimed to be ok (from check50) nothing is actually added in the ...
0
votes
1answer
422 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
107 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
26 views

When displaying price in index.html if there are 2 shares,

What is price if the stocks are different price because the price fluctuates between the two stocks? Here is my buy function app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): ...
0
votes
0answers
168 views

Pset8 - Check - Cannot get duplicate username to give javascript alert (that user must choose other username)

Below is a description of the problem, the "check() function" code, and the "register.html" file: Problem description: I haven't been able to write correct javascript (and maybe my check function ...
0
votes
0answers
98 views

pset 8 finance :( sell handles valid sale

The final check on the final (check50) assignment, and it won't pass. The specific error is 'expected to find "56.00" in page, but it wasn't found.' My code seemingly works as the desired value is on ...
0
votes
0answers
181 views

Pset8 Finance - Sell - Fails to update user's cash in “users” table, and fails to insert sold shares into “portfolio” table

Big picture: On the sell page of the CS50 Finance, I select the shares symbol I want to sell, and enter the number of shares, and click the Sell button, which redirects me to the homepage, but the ...
-1
votes
2answers
71 views

finance how to compare requested shares to shares owned

I'm having trouble trying to figure out how to write the sql statement to receive the amount of shares owned so I can compare it to the number requested, and if owned - requested < 0, don't let ...
0
votes
1answer
150 views

Pset8 finance, index not working after migrating to new IDE, why?

My "index" was working fine, but it no longer works and i get the 500 internal server error now, which has been happening after migrating to the new IDE. I does not seem to be my code. Here is what ...
0
votes
1answer
64 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
0answers
30 views

I know how to fix the code but why in index.html does len(session[“user_symbol”]) return 0?

index @app.route("/") @login_required def index(): current_symbol = session["user_symbol"] print ("current_symbol in index {}",current_symbol) if len(current_symbol) != 0: """...
0
votes
1answer
577 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
249 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
210 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
0answers
164 views

I am getting an errors in the code no idea how to fix them? [duplicate]

I did a little googling pset7 index TypeError: 'NoneType' object is not subscriptable error Found an error similar in my code. But it doesn't say how to fix it. How do I fix the code? ...
0
votes
1answer
277 views

My CS50 Finance Lookup stopped working on 15 Jun 2019. Is there trouble with the API?

Per the title, the API appears to not work.
0
votes
1answer
36 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
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
226 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 ...
1
vote
1answer
348 views

pset8 finance “/check”: Dont understand how the JS code works

I am currently working on the implementation of "/check" in pset8. I tried to implement it by reading trough the documentation of "event.preventDefaul()", "$.get()" and etc. functions. That is what I ...
0
votes
1answer
176 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
30 views

Can a select return nothing without causing an error? How do I create a if condition that returns True if the database is empty?

I posted my code in another post I have made a lot of revisions. Kind of irrelevant but just thought I should mention it if someone goes through my last post. I have a select statement. Lets say my ...
0
votes
1answer
38 views

Getting an error in buy function. Don't know how to fix it. Can someone help? More detail below

Buy function @app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): """Buy shares of stock""" if request.method == "POST": stock = request.form.get("symbol").upper() ...
0
votes
1answer
84 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
38 views

in the register function, I need help understanding why db insert works to get id for session[“user_id”]

username_form = request.form.get("username") id_db = db.execute("SELECT id from users where username=username_form") I understand why session["user_id"] = id_db[0]["id"]doesn't work to get the id. ...
0
votes
1answer
200 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
28 views

How do I select a specific part of the database

id | username | hash | cash 1 bill efgeil 10000 2 tim fgrgol 10000 3 jim h6ju8k 10000 why does username_list_check[y]["username"] need the "["username"]"? ...
0
votes
1answer
100 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
64 views

How do I get id for the buy function? I am pretty sure I am doing the correct code but still getting an error. Can someone help?

I am trying to get the code to work and am not worrying about sql injections yet. Code from Buy function current_cash = db.execute("SELECT cash FROM users WHERE id=current_id") I asked a similar ...
0
votes
1answer
221 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 ...

1
3 4
5
6 7
9