Questions tagged [finance]

The tag has no usage guidance.

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

Pset7 Index not outputting some fields in table

I am in desperate need of help, since the index method is the last method I have left to finish for this pset! So far, my index code works partially - as in, only the values I passed in from my ...
0
votes
1answer
157 views

Rectify implementation of register function in pset7 - finance (Flask)

def register(): """Register user.""" if request.method == "POST": if not request.form.get("username"): return apology("must provide username") elif not request....
0
votes
1answer
20 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 ...
1
vote
1answer
3k views

flask.cli.NoAppException Error when trying to launch web server in pset 7

I'm trying to finish up pset7 and was trying to launch the web server to view the result but every time that I do I get the above error. I'm not really sure what I'm doing wrong. I ran flask in the /...
0
votes
1answer
97 views

Problem with Total (stock price * number of shares) and Number of Shares Value in Portfolio on Index

Just recently, on my implementation of CS50 Finance, I bought 4 shares of Netflix, and then another 2, but instead of showing 6 shares on the Portfolio, it's only showing 2.  The "Total" value for the ...
0
votes
1answer
80 views

Can´t update the share values in cs50 finance /buy

So I´m currently working in the /index route and noticed it doesn't update the values when I buy something. After looking at the finance.db, I realized it doesn't update the shares or ptice at all ...
0
votes
2answers
289 views

Querying portfolio for index route PSET7/C$50 Finance/index

I have created a table named "portfolio" in my database which stores users purchase data while I kept the user_id field of this table NOT UNIQUE ie no primary key so as to let the user buy more same ...
1
vote
2answers
163 views

Pset7 => “NoneType” error on SELECT query (2017)

I’m really stuck on the index part of PSET7…. Flask keeps iterating over the following SELECT query: dab = db.execute("SELECT SUM(share) FROM portfolio WHERE symbol = :symbol AND user_id = :user_id",...
0
votes
2answers
699 views

pset7 , history table not inserting

The history table only inserts sell transaction and i don't know why because both insertions are identical both use query("INSERT INTO history (id, transaction, symbol, shares, price) VALUES (?, ?, ...
2
votes
1answer
158 views

pset7 finance unable to submit

My zipped pset7 folder is about 6oo KB and is taking hours to upload. I eventually abort because it seams to go on forever. In contrast other psets upload in a matter of seconds. Any help is greatly ...
0
votes
2answers
280 views

history.php doesn't work

I am implementing history.php as a controller and history.php as a template to display user's history. but it doesn't display anything. I made sure that history.php(controller) is readable -rw-r--r-- ...
0
votes
1answer
264 views

Finance /Check Username=undefined

I've been struggling with the check function of the Finance problem set. It seems it's unable to identify the username within the form based on the error for the link "/check?username=undefined". I'...
1
vote
1answer
88 views

My implementation of cs50 finance goes wrong with check50

My implementation of CS50 finance has security questions as personal touch on the register page. I believe this is why check50 is failing to detect successful user registration. What do I do in such a ...
0
votes
1answer
491 views

pset7 index fields are empty in page

When I logged into the webpage and bought a stock, the price of the stock was deducted from the cash balance. However, the details of all the other fields are missing as shown in the picture below. I ...
0
votes
1answer
155 views

pset7 finance key error but there is a key? def index

i have trouble with KeyError although my dict have key here is my def index() http://imageshack.com/a/img922/5265/LsdzWU.png here is my error massage http://imageshack.com/a/img923/6976/...
0
votes
1answer
11 views

All sequel Queries getting Implemented, ignoring the conditional statements

In the function buy when I am purchasing some stock, every query that i have mentioned on different conditions are getting implemented, I am unable to guess as why It is happening. Here is my code: ...
0
votes
1answer
370 views

PSET7/C$50Finance/buy

I have created two tables in my database named : portfolio and user_data. portfolio has fields as: user_id, Symbol, Name, Shares, Price, Total, Datetime all of them "NOT UNIQUE" so as to let the user ...
0
votes
1answer
198 views

pset7, buy-checking balance

I have the following lines of code to check the balance of the user. $balance = query("SELECT cash FROM users WHERE id = ?", $_SESSION["id"]); $balance = number_format($balance[0]["cash"],2); And ...
0
votes
1answer
39 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
1answer
467 views

RuntimeError: no such column: shares

My error is above. This is weird because it does exist. http://imgur.com/a/kGXsX That is my portfolio table. This is my command: purchase = db.execute("INSERT INTO portfolio (shares, stock, price) ...
0
votes
1answer
54 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
232 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
103 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
287 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
160 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
25 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
197 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
124 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
245 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
15 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
364 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
13 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
41 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
44 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
287 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
3answers
30 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
292 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
25 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
53 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
32 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
35 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
83 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
179 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
219 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
63 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
54 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
409 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 ...

1
2
3 4 5
9