Questions tagged [finance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
3 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
15 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
0answers
15 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
18 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
22 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
29 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
17 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
0answers
19 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
3answers
18 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
21 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
35 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
17 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
6 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
37 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
0answers
15 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
38 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
1answer
24 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
17 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
12 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
11 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
36 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. ...
0
votes
1answer
36 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$...
1
vote
1answer
29 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 ...
1
vote
1answer
46 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
39 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
72 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
26 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
48 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
74 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
25 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
17 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
36 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
22 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
29 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
89 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
88 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
41 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
63 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
63 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
25 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
2answers
92 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
36 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
34 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
28 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
11 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
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
105 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 ...

1
2 3 4 5
9