Questions tagged [finance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
320 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
107 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
1answer
38 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
15 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
67 views

Problem Set 8 / Finance. How to incorporate current price (index)

I'm currently struggling with index(). In buy() I created the custom table with, one might say, too many columns. Among others are symbol, name, shares, price, total. So far I was able to plug some of ...
0
votes
1answer
20 views

KeyError: 'price_per_share': Webtrack CS50

I am currently trying to complete finance, but got the "Internal Server Error" apology along with the KeyError in the title when trying to run index. Below is the error text I received and ...
0
votes
0answers
10 views

finance ensure integer input using int()

I noticed that finance.cs50.net when I give an input like suppose 5.0 it gives an error. Is there any way to replicate it as using the int() function doesn't work?
0
votes
1answer
86 views

PSET8 Finance Buy. SQL query not executing

My buy function is crashing at the SQL query where I'm trying to insert data from the transaction into a transactions table. The types of each column are transaction_id(integer, primary key), user_id(...
0
votes
1answer
53 views

set8 tracks/finance cs50

Im getting error 500 messages, when it should instead show the index page after buying or when clicking on history and sell. This is my code for index(). def index(): """Show ...
0
votes
0answers
17 views

Jinja scope help

def index(): """Show portfolio of stocks""" price = [] num = int(db.execute("SELECT count(name) FROM sqlite_master WHERE type='table' AND name='tracker'&...
0
votes
1answer
26 views

finance cosntraint syntax error

def buy(): """Buy shares of stock""" if request.method == "GET": return render_template("buy.html") else: if not request....
0
votes
1answer
445 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
19 views

Finance sql doubt

I would like to know if there is a way to insert certain set of values replacing the older ones ie without creating duplicates
0
votes
1answer
22 views

Web track finance error sql

def buy(): """Buy shares of stock""" if request.method == "GET": return render_template("buy.html") else: if not request....
0
votes
1answer
13 views

Web track finance error

@app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): """Buy shares of stock""" if request.method == "GET"...
0
votes
2answers
71 views

Finance Register Checking for Duplicate Username Not Working

I've looked at lots of other questions with people who have code for register, and my SQL code is exactly the same as most of them, but when I register, it lets multiple people have the same username. ...
1
vote
1answer
30 views

INDEX only pulling row of data from database

For the life of me I cannot get my index page to properly display the data from my database. I have tried multiple methods and research on several sites. I'm thinking it is something right in front of ...
0
votes
1answer
71 views

CS50 Finance Internal Server Error RuntimeError: near “' '”: syntax error

I'm working on the register section of application.py. When I've typed in the username and password and hit register, I get an internal server error. I'm assuming that pbkdf2:sha256:150000$uJ2F7qcX$...
0
votes
1answer
140 views

Finance index function does not return lookup value in index.html

I'm trying to render my lookup values inside of my index function implementation, but I cannot get these values to render in my index.html page. I added share = lookup(record['share_symbol']) to grab ...
0
votes
1answer
32 views

Finance index.html is not rendering values from my index function

I'm having some issues trying to render values on my index.html page. In my index function, I created a dictionary of values from my transactions table to grab each record of my share symbols, share ...
0
votes
1answer
107 views

Finance history, runtime error(“unsupported value: {}”.format(value))

After creating a table to handle and record all transactions, I seem to run into problems with my buy and sell functions when I try to update the history table. Specifically this line of code: # ...
0
votes
1answer
28 views

Finance Portfolio (index) I can't go on. Need to take to HTML the actual price and total of stock

I am stopped at this part of Finance now. I can print at HTML the symbol and the sum of the shares... but I don't know how to take the iteration for each symbol to the HTML to know the actual price ...
0
votes
1answer
22 views

Problem taking a SUM with SQL to python

I am doing Finance and I am fighting with this code... could anyone help me? I want to "select" some data from a sql table and put this value to a variable in python (a specific FLOAT number)...
0
votes
0answers
51 views

Problem with endblock tag in finance. “endblock” tag unknown

{% extends "layout.html" %} {% block title %} Quote {% endblock %} {% block main %} <form action="/quote" method="post"> <div class="form-...
0
votes
1answer
27 views

Dynamically change the row colour of a table in HTML that was generated using jinja

As part of PSET8 finance additional implementations, I want to dynamically colour the table in history.html. The simple code uses jinja2? to populate and print out a table in html. {% extends "...
0
votes
0answers
34 views

check50 showing all okay for incomplete submission

Editing my question slightly. After uploading submission, check50 is only showing a smiley with "Finance submitted" (see screenshot below). My "progress" page is also showing ...
0
votes
1answer
45 views

CS50 Web Track Finance Index not displaying Data

EDIT: I fixed the issues with the Data but now the webpage looks really bland (default text, font, etc) and does not match the format of the other pages. Am I missing something in my HTML? {% extends &...
0
votes
1answer
103 views

Finance - Error with Index

I can't seem to figure out where I've gone wrong with index. I keep running into these two errors: After login, when directing to index - 500: Internal Server Error (raise TypeError("...
0
votes
1answer
116 views

pset8 finance - 'NoneType' object is not subscriptable - issue

I have read in other comments that API may return error sometimes due to volume and others. Is there a way around it? Can we temporary bypass the issue, or is there any way to continue checking other ...
0
votes
0answers
31 views

Finance CS50 Buy Function - Sufficient Cash check not working

I've been stuck on buy function for PSET8 Finance for a long time now. I'm stumbling at the very beginning and can't seem to proceed further. The code error checks for incorrect or no inputs in the ...
0
votes
1answer
44 views

Password leak in finance

I'm running into an issue on finance. Whenever I register a new account a google alert pops up and tells me that my password has been leaked and that I should change it. Is anyone else running into ...
0
votes
1answer
42 views

cs50 Finance Runtime error FOREIGN KEY constraint failed

I'm working on pset8 cs50 finance and I'm encountering a runtime error with buy. I've gotten both register and quote to work without issue so I've tried comparing my code to check for incorrect syntax,...
0
votes
0answers
32 views

HTML: Trying to download files from directory

On the quote.html page I have a download button that I want to download the text.txt file in the files folder but when I press the button it tries to downloads text.htm and outputs an error since ...
0
votes
0answers
150 views

CS50-Finance Flash message persisting throughout session after flask.redirect()

In my register() function, when registration is successful I have flash("Registration successful","success") before return redirect("/") The flashed message is displayed normally after rendering ...
0
votes
0answers
27 views

What is the error in my code? (Finance)

I cannot seem to figure out what my problem is. Checked Line 81 several time (Yes I have made the table and all in the database). Even after removing the line, the syntax error shifts to Line 81. Only ...
0
votes
0answers
41 views

CS50 Finance - SyntaxError: invalid syntax on def history(): and all other functions

I have been struggling with this trying to debug this syntax error that I have been getting. Currently, the error is on the history function, and it says that there is some syntax error in my history ...
0
votes
0answers
23 views

Finance - Creating a leaderboard - TypeError

I'm trying to create a leaderboard page to show which users have most money in the finances project: This is the python code in 'application.py' for my leaderboard page: @app.route("/leaderboard") @...
0
votes
1answer
46 views

Finance: Ensuring no duplicate usernames

I've implemented the following code in my "/register" route: def register(): """Register user""" if request.method == "GET": return render_template("register.html") else: #...
0
votes
1answer
44 views

Internal Error Served if user doesn't own any shares or sell all his shares in Finance

When i sell all the shares i own or even in the case of a new registered user who doesn't own any shares; it doesn't redirect to "/" i.e the main index page but serves me an internal error. It works ...
0
votes
1answer
17 views

How to return a value while calculating between two columns from the same table in postgresql?

I'm trying to write a SQL query for Postgresql where I'm subtracting a value of a column in a row with that of another row in the same table and returning the result. I can use IS NULL in SQL, and ...
0
votes
0answers
47 views

Passing parameters to sqlite3 throws incorrect number of bindings error

Trying to rewrite my query for the finance webapp to use sqlite3 module without relying on cs50 module, and running into this error: "sqlite3.ProgrammingError: Incorrect number of bindings supplied. ...
0
votes
0answers
13 views

CS50 Finance Not Working, Error message says reason for error is colon? Help me

I have been working on this for a long time, and it still is giving me an error message saying that a letter s is the only reason for all of my problems. Here is my code in Flask. @app.route("/...
0
votes
0answers
83 views

Problem set 8 / Web Track - Finance (sell does not update)

My code is almost done, but the sell function does not update the index table and at the terminal shows no error... How may i solve this?? Thanks in advance. Here is my fully code: import os from ...
0
votes
1answer
147 views

Problem Set 8 / Web Track - Finance (RuntimeError: UNIQUE constraint failed)

y'all. My register function seems to work just fine when inputting new and different usernames. However, when I tested it for the 403 error (ie the one which checks if there is an already existing ...
0
votes
0answers
20 views

Register showing username is not defined and outputting INTERNAL SERVER ERROR

def register(): """Register user""" session.clear() if request.method == "POST": passhash = generate_password_hash(request.form.get("password")) if not request.form.get("username"): ...
0
votes
1answer
41 views

C$50 FINANCE- BUY ERROR

I have a problem with my code on buy. I was wondering if anyone can help me identify the error. Whenever I go to the buy and enter the symbol and shares and click buy, it shows a 500 Internal Server ...
0
votes
2answers
263 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
0answers
431 views

cs50 finance register function

Could someone please explain how the script code works in register.html if a username is already taken in the database? Basically, if the username exists, i don't want to pass the 'apology' function, ...
0
votes
2answers
691 views

cs50 pset7 finance index function, index page returns html table with multiple instances of only one transaction

Hi, I’m stuck with pset7 finance for a while. I managed to implement quote and buy functions but got stuck with index. Right now my database has two tables, users an portfolio. Users table is ...

1 2
3
4 5
9