Questions tagged [finance]

The tag has no usage guidance.

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

TypeError: a bytes-like object is required, not 'NoneType' in Finance

I finished doing finance and tested it without many errors i would say. Fun fact, i was implementing a change password and it got me this error TypeError: a bytes-like object is required, not '...
0
votes
1answer
46 views

Pset8 Finance stocks typed in lower case don't appear in portfolio

I noticed a beta-tester was typing in the stock symbols in lower case. This didn't seem to cause a problem for purchasing or selling, and the transactions appeared in the History table. However, they ...
0
votes
1answer
24 views

Pset8 Finance occasional NoneType error

I had someone beta-test the website today and they ran into an internal server error when trying to return to the index/show portfolio of stocks screen. The error was this: File "/home/ubuntu/...
0
votes
0answers
51 views

Pset8 Finance def buy() throws internal server error

Everything was going fine and I refreshed the page to check my updates when I got an internal server error and the whole page didn't load. I looked in my IDE terminal and it said File "/home/ubuntu/...
0
votes
0answers
64 views

Database Issue after deploying Final Project to Heroku

2020-02-18T18:17:40.919793+00:00 heroku[router]: at=info method=GET path="/static/styles.css" host=pk-finance.herokuapp.com request_id=5032b709-e476-470a-9d00-747f7e9e5bf8 fwd="116.87.240.97" dyno=web....
0
votes
1answer
29 views

PSET Tracks Flask and JS

I'm stuck with the course track Flask. I write same code as the teacher but something fail at the end with JavaScrip. {% extends "layout.html" %} {% block body %} <form action="/add" method="...
0
votes
1answer
67 views

Finance check50: /register & /check return “expected status code 200, but got 400”

My Finance program works, python and javascript both, however, I continue to receive errors when running check50. This seems to be related to my registration function. After looking at various ...
0
votes
0answers
245 views

FINANCE [UNIQUE constraint failed: users.username] Error encountered using check50

I have finally got my entire program working for PSET8 Finance. I receive no errors in my dev console and all functions are working correctly after registering 15 users. For some reason, though I get ...
0
votes
0answers
144 views

PSET8 CS50 Finance: /Check fails to run, does not catch or notify of duplicate usernames

I have been struggling with the check function in PSET8 for a few weeks now, and have run into various problems as I tried to work through my issues. Currently, it seems by check .get function does ...
0
votes
1answer
185 views

RuntimeError: missing value for placeholder (:symbol)

Hey Guys! I am getting this error for symbol, any suggestions on that
2
votes
2answers
1k views

pset8 2019 - jinja_env.filters error

I have just downloaded the code for pset8 and the line 26 app.jinja_env.filters["usd"] = usd shows an error. The code hasn't been modified yet and when I run the flask run command I get this error: ...
0
votes
1answer
52 views

int object not subscriptable in register route

Hello: while registering int object not subscriptable error coming, even though i truncate [0] from results. Any thoughts
0
votes
1answer
29 views

Finance: How to check if input is valid in “quote”?

I'm a little bit stuck with checking if user's input is correct. I don't know how to properly call "name" and other fields inside of lookup function to check them. I've tried different combinations of ...
0
votes
0answers
35 views

stuck on pset 8 finance [duplicate]

I have an error in set 8 finance. It says :( buy handles valid purchase expected to find "112.00" in page, but it wasn't found sending POST request to /login sending POST request to /buy ...
0
votes
0answers
200 views

Pset 8 Finance TypeError: 'bool' object is not subscriptable

Does anyone know, what can be the source of this error. I have no bools in register or check, but it is haunting me. Maybe anyone can share the tests chec50 does. This is ridiculous. There is no ...
0
votes
1answer
21 views

Does every SQL table need a primary key?

In the Week 8 shorts, Mr. Lloyd is talking about a set of Seinfeld related tables. The first has a primary key but the second does not. I was under the impression that every table needed to include ...
0
votes
1answer
38 views

Problem with sending data to /check through $.get and then accessing it

So I have made my JQuery capable of making the AJAX request. However, I have a few issues. First, in my IDE console it appears that I'm saying SELECT * FROM users WHERE username =NULL when it ...
0
votes
1answer
52 views

My JQuery doesn't do anything in /check pset7 finance

So I'm currently working in the /check route and have tried to make it work to no avail. I'm pretty sure the error lies in my JQuery but I don't know how to fix it. Any help is aprreciated. register....
0
votes
1answer
139 views

Why do i get a 400 error with finance login?

I have made the register page. And am now trying to login, to the finance app, however I get a "400 error". I also get a 302, which I'm unsure if is relevant. DEBUG:cs50:SELECT * FROM users WHERE ...
0
votes
1answer
142 views

Finance pset, register will not insert user data

I've completed register page html, and it works as expected. However, it won't insert the data from the user into the database. There are no errors. I can't seem to find how to debug python/flask ...
0
votes
1answer
22 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
110 views

pset8 finance - 500 error when trying to UPDATE users table (updating users CASH balance)

Here is my code so far for "/buy" @app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): """Buy shares of stock""" # User reached route via GET (as by clicking a link or via ...
0
votes
1answer
89 views
0
votes
1answer
56 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
328 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
3k 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
113 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
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
83 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
381 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
649 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
198 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
77 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
100 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
78 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
40 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
65 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
38 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
62 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
149 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
57 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
380 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
101 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
158 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
79 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
141 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
64 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 ...

1 2 3
4
5
9