Questions tagged [finance]

The tag has no usage guidance.

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

Finance - Missing Value For Placeholder

As far as I can tell, I have the value set - username = username. Am I missing something stupid here? Code: @app.route("/register", methods=["GET", "POST"]) def ...
2
votes
1answer
212 views

CS50 2019 PSET8 updating API from 2017 API

I have a lot of work from finance 2017, but it seems to use a different API than what I used last year. How do I update my code to use this new API? Or can I just use the one from last year? (I don't ...
0
votes
2answers
23 views

CS50 pset8 finance buy

I have been struggling with the buy portion of the finance assignment for CS50. I have created my new tables and written down the logic concerning buying stocks. When I run flask and try to purchase ...
2
votes
1answer
286 views

I receive “Not authorized to access this private project” page when trying to get to CS50 Finance page in pset7

I think something is incorrect with my permissions when I'm trying to set up my pset7 materials per the spec. I've followed the spec exactly. I used username50 and password50 to put my username and ...
0
votes
1answer
143 views

pset8 c$50 finance /buy - transactions RuntimeError: (sqlite3.OperationalError) near “''”: syntax error

I'm stuck on pset8 c$50 finance /buy: Form validation works properly but when i try to execute the INSERT INTO transactions table i get the following error: RuntimeError: (sqlite3.OperationalError) ...
0
votes
1answer
24 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</...
0
votes
1answer
147 views

Finance datetime

I wish to add the date of the transaction in a DB (SQLite) date = db.execute("""SELECT date('now')""")[0]["date('now')"] But the date is only in format: 2020-02-18 I need YYYY-MM-DD-HH-SS I've try:...
0
votes
1answer
112 views

Finance: Can not Update and Insert to SQL

In my buy function I cant INSERT or UPDATE data in SQL. RuntimeError: (sqlite3.OperationalError) near "ON": syntax error [SQL: INSERT INTO buy (share_name, share_symbol, share_price, shares, id) ...
0
votes
1answer
219 views

Finance - PSET 8 (2019) - Check50 bug -> :( buy handles valid purchase

I'm encountering the following bug with one of check50s test scripts: expected to find "112.00" in page, but it wasn't found Log sending POST request to /login sending POST request to /buy ...
0
votes
1answer
13 views

CS50 Finance/Own website log-in Check Error

I'm currently trying to implement code to ensure that once a user has registered, they can then log in. However, when I click the /login link I get an Internal Server Error. In CS50 IDE I get this ...
1
vote
1answer
344 views

Pset7 - CS50 Finance - Register - returns the same apology each time

When im testing my code by entering in blank entries in username or password, i expect the site to show me the apologies like "Must provide username" or "Must provide password", but it only shows the ...
0
votes
1answer
12 views

How to enter Jinja variables as values in my tags

I am using Jinja and am trying to set the "value" of the option to a variable. I tried this: <option value = {{stock['name']}}>{{stock['name]}}</option>, but it thinks that the {{stock['...
0
votes
1answer
24 views

Finance - Index showing correct number of rows but all the same record. For- loop issue?

So I've been looking at this all morning and can't figure what I'm doing wrong. All my variables are producing the correct values so it seems to be something to do with my For loop. In the html ...
0
votes
1answer
21 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
1answer
16 views

Finance - trouble implementing javascript

I am trying to set up my index page so that each stock in the user's portfolio has buttons to buy and sell said stock. The first step is working so far. Each row in the index table has buy and sell ...
0
votes
1answer
39 views

How to tell if selling shares results in a negative amount pset8

This is the code I have at the moment dbshares = db.execute("SELECT :shares FROM portfolio WHERE user_id = :user_id", shares=shares, user_id=session["user_id"]) if dbshares[0]['shares'] - shares &...
1
vote
1answer
2k views

CS50 Finance 2019 /check subproblem

In the 2019 edition of CS50 Finance there is a final subproblem where you have to use AJAX to ask the server if a username a new user is trying to register with is already taken, and then alert the ...
3
votes
1answer
2k views

can't get the site to run

i'm almost done with the pset7 and this happend , something has gone wrong and cant figure it out . first i couldn't get the apache50 to start then i found this on web "echo > ~/lib/apache2/log/error....
0
votes
1answer
247 views

CS50 Finance 2019 Check50 errors

I have been stuck on this for a while now. No matter how I change my code nothing works it's the same 3 errors. I think the issue is in my register.html but I can't find anything wrong with it. Here ...
0
votes
1answer
26 views

PSET8 Web Finance - Index/Portfolio - Why do my for loop variables not pull over to Portfolio.html?

I have the below code for my application: #valid stock row queries valid_stocks_rows = db.execute("SELECT symbol, SUM(shares) as sum_total FROM ledger WHERE user_id=:user_id GROUP BY symbol ...
0
votes
3answers
23 views

pset8 Finance History - rows repeat in the table in number of times per length of rows

Do not know the reasons why the row in the HTML table will repeat in number of times per the length of rows. Please see my codes as follows: application.py rows = db.execute("SELECT * FROM ...
0
votes
1answer
209 views

CS50 Finance lookup function always returns NONE

After a week or so of idle i returned to finance and tried to chek my buy function. I bought some stocks of apple(AAPL) but got invalid symbol error, when i tried to use quote(this function always ...
0
votes
0answers
16 views

CS50 Web Track - Finance: OSError: [Errno 99] Cannot assign requested address

I'm trying to create a standard 'forgot password' feature for my web application. The issue is, when the user types in their email address and clicks submit to receive a token after which they can ...
0
votes
0answers
30 views

Finance - Buy Implementation

I am getting the error message "500 Internal Server Error" when trying to buy shares. Can you please tell me what I am missing? The application.py code is: @app.route("/buy", ...
0
votes
1answer
28 views

Week 8 - Finance - Buy - Getting Error Message Missing Shares

I'm trying to get the Buy implementation to work but I keep on getting the error message "Missing Shares" when I log into the cs50 finance site and enter in the symbol and number of shares. ...
0
votes
1answer
34 views

Update portfolio on duplicate id and stock

So I think I know where the problem is, it's trying to update the variable shares taken from the form, and add the shares from the form and the new amount of shares, which is not helpful. I need to ...
0
votes
1answer
53 views

CS50 Finance Register

I was able to figure out the POST and /register, but I am confused on how to use INSERT a new user into users. Any help would be appreciated. Thank you. From application.py @app.route("/...
0
votes
1answer
114 views

PSET8 Finance Buy

For some reason, my buy function will not work. When I try to "buy" a share of stock, it always goes to internal server error. Here is my code: def buy(): if request.method == "POST&...
0
votes
1answer
207 views

Struggling with error on CS50 Finance Problem - expected status code 200, but got 400

I would like to ask for your help please with an error I keep getting on my code for the Finance problem. I can't seem to find a solution for it :/ I keep receiving: :) application.py exists :) ...
0
votes
1answer
61 views

Javascript isn't running at all in pset8 check

I'm not sure how to run my javascript in pset 8. I used a normal script tag to link it in my register/html file. I'm not sure I need to link it from the application file. Do I need all the JS to be ...
0
votes
1answer
50 views

When stock and user exist, update (PSET8)

I'm trying to make it check if the user already owns this stock, and if they do, then to update the portfolio. I'm confused about how to get this code to work as I don't understand how to check if it ...
0
votes
1answer
38 views

Why table is not inserting here in buy route

Hello Folks! I am working on paset8, why table is not inserting into buy route
0
votes
1answer
284 views

Problem Set 8 / Web Track - Finance (Redirect Error)

My functions seens to work fine, but when i have that redirect the user to the homepage (redirect("/")) the application crash and show the error message: 500 internal server error and I don't know if ...
0
votes
1answer
79 views

unindent error on the template given

I have been stuck on pset7 finance due to an error called 'unexpected unident'. It is giving me an error on the @app.route("/history) portion, the arrow is specifically pointing to the @ symbol. I ...
0
votes
1answer
22 views

How to disable a button after it was clicked ? finance-pset7

I would like to add a button (Give me $12.000) to my index.html. The purpose is that a user can only once receive additional cash = 12000 by clicking that button. After a click, I do not want to ...
0
votes
0answers
21 views

finance password strength validation fails to call function

I'm trying to call a function which I've defined but the code fails to call it. Does it matter where the function is defined? def register(): """Register user""" ...
0
votes
1answer
297 views

IndexError: list index out of range in Finance

When I sell a stock on my website, an error pops up. The Terminal shows that in the sell() function, this line's index is out of range user_shares = int(db.execute("Select Shares from Portfolio ...
0
votes
1answer
42 views

pset7 finance where to write buy

I'm having trouble on buy because I'm not sure where to write the html, it doesn't specify where to write the inputs for but and I'm confused about where to write that, do I make a buy.html? I have ...
0
votes
1answer
101 views

I'm making a route “/Account” to allow user to change password. I'm a bit confused about GET and POST requests

I thought I sort of understood GET and POST requests in that: GET request means the user only retrieves data from the server; cannot change anything like the database POST request means the user can ...
0
votes
2answers
130 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
1answer
51 views

I can't even get register to work. What am I missing?

I'm getting a Error 500 (-Internal error due to server overload) when I attempt to flask run for pset8-Finance. Here is my app.route("/register") @app.route("/register", methods=["GET", "POST"]) ...
0
votes
1answer
37 views

I can't find where my variable names are mixed up

I'm stuck on pset7 and I have been for a while. I'm working on index and I'm pretty sure some of my variable names got mixed up, or I used the wrong names or something like that. I just can't figure ...
0
votes
1answer
437 views

Problem retrieving index variables in finance

The table is not able to access different variables to display in the table. Here is the index function def index(): """Show portfolio of stocks""" """Selecting shares that have been purchased ...
0
votes
1answer
83 views

Pset7 Finance Buy Runtime Error - Date

When I try to update the users portfolio I receive a runtime error from passing in 'when' as date('now'). Please can someone tell what I should be doing. Here is part of my buy function code. # ...
0
votes
1answer
185 views

Stuck at 57% in Pset 8 Finance

I cannot fix some problems in Pset8 because in my gradebook, Finance is still at 57%. Here are the errors that I have after I used check50: :( logging in as registered user succceeds application ...
0
votes
1answer
24 views

FINANCE: GROUP BY doesn't add up the numbers of shares of the same stock

So in index i'm trying to display a table with all the stocks that the user has bought, one row for each stock, displaying the total number of shares in the user's portfolio along with the total value ...
0
votes
0answers
14 views

FINANCE: how to commafy numbers in jinja?

I was wondering about how to commafy large digits in jinja so that instead of [$10000 / $100000 / $1000000] these numbers would be displayed as such [$10,000 / $100,000 / $1,000,000] I've been looking ...
0
votes
1answer
91 views

Pset7 Finance Unable to Buy Multiple Shares

I am able to make 1 purchase which appears on my index page, however if I try buy any further stocks my cash goes down but the stocks are not shown and aren't inserted into my portfolio. Here is my ...
0
votes
1answer
100 views

CS50 Pset7 Finance HTML Table Not Aligned

The index table looks pretty good, but the "Price" and "Total" columns in the history table are not aligned with the headers. The code for the two is nearly identical. Here is the code for index....
1
vote
1answer
66 views

CS50 Finance: Index - list indices must be integers or slices, not str

I've been stuck on this for quite some time. I believe that I'm getting back data in the form of a dictionary but can't figure out how to get the information that I need. Error messages that have ...

1
2 3 4 5
9