Questions tagged [finance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
4 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 ...
0
votes
1answer
11 views

CASH NOT UPDATING - FINANCE SELL

so everything I have so far is working except the part where I need to update the cash right after I sell a stock. As you can see in the table below what's happening is that everytime I sell a stock ...
0
votes
1answer
14 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
13 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
10 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
16 views

Finance PROBLEM with lookup: TypeError: quote_from_bytes() expected bytes

I have Finance barely ready but like most codes, it has a buggy near the finish line. I have a problem with lookup. Always return None. I check it. and Terminal shows this error: TypeError: ...
0
votes
1answer
16 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
13 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
12 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
19 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
24 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
0answers
44 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
35 views

The view function did not return a valid response. The function either returned None or ended without a return statement

I can't figure out what is wrong in my code My python code: def buy(): """Buy shares of stock""" if request.method == "GET": render_template("buy....
0
votes
1answer
30 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
49 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
34 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
16 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
10 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
38 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
25 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 ...
0
votes
1answer
25 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
21 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
1answer
10 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 ...
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
0answers
31 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
67 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
23 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
13 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
1answer
99 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
22 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
28 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
29 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
15 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
24 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
12 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
41 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
126 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
82 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
17 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"): ...
1
vote
2answers
126 views

CS50 FINANCE- INDEX doesn't display price

I am trying to do the index part of this pset but the problem is since I want the price to be the current price, not price bought, I need to use the lookup function. But how do I display the price? ...
0
votes
1answer
30 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
0answers
188 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
1answer
32 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
16 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
35 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
1answer
15 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
82 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
0answers
42 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
26 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
512 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 '...

1
2 3 4 5
8