Questions tagged [sell]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
28 views

PSET 9 Finance checking that "56.00" is in page

I've been trying to solve this issue for hours and every time I run the code I get the error: ****:( sell handles valid sale Cause expected to find "56.00" in page, but it wasn't found Log ...
user avatar
  • 1
0 votes
1 answer
35 views

FINANCE SELL : DROPDOWN MENU not showing any option DESPITE having look for solutions

This is my first time posting on reddit asking for help : I've been so far going through cs50 on ressources online when I got stuck, but here I can't figure it out even tho with the numerous online ...
user avatar
  • 1
0 votes
0 answers
75 views

Pset9 - Finance sell function not working

Can anyone help me with this problem? check50 keeps returning these lines, but I don't know what is the problem, since the web application works fine when I test it manually. :( sell handles invalid ...
user avatar
0 votes
1 answer
70 views

Cs50 Finance :(sell handle valid sales :values appearing in index table but check50 doesnt recognise it

updated the code to display history properly,ie when sold shows negative,and when bought shows positive updated index to remove entire row when stocks is 0 I cant figure out why check 50 is not ...
user avatar
  • 1
0 votes
1 answer
43 views

Buy/Sell on Index - button attributes & form value issues

I've got a couple issues adding my own buy/sell buttons to the index page. First, each "Buy" or "Sell" buttons opens up the form for all of the table rows. How can I modify these ...
user avatar
  • 1
0 votes
0 answers
136 views

Is there a bug in check50 cs50/problems/2021/x/finance?

I completed problem set 9 and works as supposed, but with check50 I get the following result: :( sell handles valid sale expected to find "56.00" in page, but it wasn't found For testing ...
user avatar
  • 1
0 votes
1 answer
436 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: ...
user avatar
0 votes
0 answers
221 views

Pset8 Finance - Sell - Fails to update user's cash in "users" table, and fails to insert sold shares into "portfolio" table

Big picture: On the sell page of the CS50 Finance, I select the shares symbol I want to sell, and enter the number of shares, and click the Sell button, which redirects me to the homepage, but the ...
user avatar
  • 7
-1 votes
2 answers
80 views

finance how to compare requested shares to shares owned

I'm having trouble trying to figure out how to write the sql statement to receive the amount of shares owned so I can compare it to the number requested, and if owned - requested < 0, don't let ...
user avatar
0 votes
1 answer
288 views

pset 8 finance: :( sell handles valid sale

:) Struggle with the last check. Get this error message: expected to find "56.00" in page, but it wasn't found Tried the same approach like I used for the buy-function. Create an extra template to ...
user avatar
0 votes
1 answer
104 views

pset8 finance: Problem with calculaton for "/sell"

I'm implementing the "sell" function and have a problem with the calculation of the new value for "share" and "cash". Here is my code: @app.route("/sell", methods=["GET", "POST"]) @login_required ...
user avatar
0 votes
1 answer
349 views

PSET7 Finance- Quote and Buy not passing all checks

I've just come back to CS50 after the semester ended and have been trying to debug my program to no avail. The application appears to be working when I test it myself, passes all checks, but has ...
user avatar
0 votes
1 answer
41 views

Pset7 Sell stockprice not a bound parameter

I'm working on sell, and I ran into trouble in one of my db.execute statements. For whatever reason, in the previous line, it was perfectly fine using stock["price"] but in my second db.execute, it ...
user avatar
0 votes
1 answer
143 views

Pset7 :( sell handles valid sale

I try to UPDATE cash but I get an error I don’t understand why. Used this syntax in buy and it works fine but now File "/home/ubuntu/workspace/pset7/finance/application.py", line 243, in sell ...
user avatar
0 votes
1 answer
136 views

after using style50 and correcting my spaces etc I ran my code again and got this error which makes no sense to me. need some help please?

def buy(): """Buy shares of stock""" if request.method == "GET": return render_template("buy.html") else: info = lookup(request.form.get("symbol")) if not info: return apology("...
user avatar
0 votes
1 answer
178 views

problem , yet again in pset7 . my sell page works fine but check50 shows me something else O.o

def sell(): """Sell shares of stock""" # method check if request.method == "GET": return render_template("sell.html") else: # valid name info = lookup(request.form.get("symbol")) if ...
user avatar
1 vote
1 answer
768 views

CS50 PSET7 Finance: in SELL; expected to find select field with name "symbol", but none found

My CS50 finance app passes all check50 tests except just one in the SELL component. I just can't find the error and need thoughts/ideas / tried a lot ( read: a-lot). My code was created in 2017 and ...
user avatar
0 votes
2 answers
144 views

pset 7 sell Type Error 'NoneType' object

I am working on sell and I am getting an error: "TypeError: 'NoneType' object is not subscriptable" on the variable "price". I am not sure why as this is more or less the exact same code I have in buy ...
user avatar
  • 21
0 votes
1 answer
369 views

sell.html Dropdown Menu Problem

So, as the title says I can't figure out what I'm doing wrong to give the user a drop-down menu which contains the symbols of his/her stocks. Thank you for your time in advance! My intention is: -...
user avatar
  • 13
0 votes
1 answer
2k views

CS50 finance: Sell function.(Dropdown list of user shares NOT displayed via sell.html)

Purpose of Sell: to make sure the shares bought can be sold by selecting it through a dropdown list displaying symbols of share bought. I am trying to replicate the cs50 finance default page. I have ...
user avatar
  • 23
0 votes
1 answer
302 views

pset7 sell: can not make drop down menu work

i can not get why drop down menu does not work. It seems that the list is empty, but when I check it in another program, it contains information as expected. I just don't get why the dorpdown list is ...
user avatar
  • 11
0 votes
1 answer
501 views

Pset7 Finance, Sell problem with POST requests

My problem is that I'm not getting any value back from my select form. I pass a list of stocks to the jinja template via return render_template("sell.html", stocks=stocks) and on the sell.html page I ...
user avatar
  • 15
0 votes
1 answer
93 views

Buy and Sell Function not working correctly

Okay I have been working for very long on pset7 but my buy function seemed to be working correctly however when I try to buy the same stock a second time it doesn't get updated in the portfolio table ...
user avatar
0 votes
0 answers
310 views

pset7 buy/sell shares via index

As last task to do for pset7, "personal touch", I'd like to empower the user to buy and sell shares via index without having to type the stock symbol. From here I found interesting to create a form ...
user avatar
0 votes
1 answer
386 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 ...
user avatar
  • 302
0 votes
1 answer
413 views

PSET7/C$50Finance/sell

My portfolio table has fields user_id,Name,Symbol,Shares,Price,Total,Datetime showing who bought what at what price & when aka a record of all users buying their stocks. Now, if there is a user ...
user avatar
  • 302
0 votes
1 answer
59 views

Rum time error with SQL statement in sell() when try to get total of shares from finance.db

Here is the error SQL statement: RuntimeError: (sqlite3.OperationalError) near ",": syntax error [SQL: "SELECT stock, SUM(shares) AS shares FROM 'transaction' WHERE userid = 3, stock = 'FB'"] I'm ...
user avatar
0 votes
1 answer
286 views

Pset7 sell - list out of range

So I am having trouble implementing the if function to test whether the number of shares the user is requesting to sell is less than the number of shares they have for that stock. Here's what I have ...
user avatar
0 votes
1 answer
485 views

Jinja2 + Python error "TypeError: non-empty format string passed to object.__format__"

I tried to implement sell, but there's a problem in the index template that came up when the website tried to redirect from sell.html to index.html after the sail of stocks was done. For reference, ...
user avatar
0 votes
0 answers
90 views

Undefined index problem in Pset7 Sell

I have a problem as in here: pset7 sell controller issue: undefined index. I made a new thread because that one's a year old. I hope this one won't get marked as a duplicate and get closed for it. ...
user avatar
0 votes
1 answer
193 views

sell in pset7 - delete and update query bug

I hope I can get some help here (and hopefully this isn't too much of a duplicate of another thread). I've got some code here that I want to have checked to see why this weird thing is happening and ...
user avatar
0 votes
1 answer
62 views

weird fatal error in sell

I am trying to update my history table using the below query: // update history table CS50::query("INSERT INTO history (user_id,sold,sold_number,selling_price,date) VALUES(?,?,?,?,NOW() )",$_SESSION[...
user avatar
0 votes
1 answer
45 views

pset7 sell.php I seem to be missing something

I just finished sell.php, but I had to use $cash[0]["cash"], to get cash out of my query. This dos not feel right. The code works, but I feel it is wrong. Is there a better way to do this?? <?...
user avatar
0 votes
1 answer
65 views

Unable to manually insert rows in Portfolio table

Working on sell.php now. Trying out Sell, I naturally find the need to replenish shares of some stock after selling, for testing purposes. When I try to manually insert, like instructions said to do ...
user avatar
0 votes
1 answer
63 views

Pset7 pass data to drop down bottom

I'm now trying to make the sell button, and have a problem. I try to do the query from data base just like index.php did. And then I transfer the $rows results to sell_form.php(where show the button). ...
user avatar
0 votes
1 answer
48 views

pset7 unsupported operand types

I am wrestling with an "unsupported operand error". According to Stack Overflow the problem is that I am trying to do math with an array but doesn't $ticker[0]["shares"]; refer to a single data point ...
user avatar
0 votes
1 answer
49 views

sell.php doesn't return error when the stocks doesn't exist in the user's portfolio

<?php require("../includes/config.php"); if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["stock"])) { apologize("You must provide the stock you want to sell."); } ...
user avatar
0 votes
1 answer
193 views

Pset7 Sell: can't display dropdown menu items

Trying to implement a dropdown menu in sell_form.php so that the user can choose one of the stocks he/she owns and sell it. However, the dropdown menu doesn't seem to be working properly, can someone ...
user avatar
  • 120
1 vote
1 answer
157 views

pset7 sell.php Fatal error: You have an error in your SQL syntax

I can't find my mistake for a few hours already, and I keep getting the same error: Fatal error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version ...
user avatar
  • 235
0 votes
1 answer
80 views

I am currently working on sell.php. I have debugged the code several times but I am unable to find the error.?

Sell.php // if user reached page via GET (as by clicking a link or via redirect) if ($_SERVER["REQUEST_METHOD"] == "GET") { // else render form $rows = CS50::query("...
user avatar
0 votes
1 answer
62 views

pset7 sell: MVC problem

I can't seem to connect my sell_index.php (Where I get the symbols in with query) with my view, sell_form.php, because $symbols is empty. I have sell working if I directly get symbols in sell_form.php,...
user avatar
0 votes
1 answer
195 views

Pset7 - Issue with updating cash in sell.php

I wrote some code for sell.php in CS50 Finance, but the cash field in the users table does not update accurately. The code for updating this field is towards the bottom. This is really driving me ...
user avatar
0 votes
0 answers
101 views

how to save history

i am through with the register and quote but why do i get this error in trying to create history? Fatal error: Table 'pset7.history' doesn't exist in /home/ubuntu/workspace/pset7/vendor/library50-...
user avatar
0 votes
1 answer
106 views

Pset7 Sell.php not adding money to users

I have been working on the sell page for Pset 7. I have it so when i sell it removes the proper stock from the portfolios database. But for some reason it is not updating the cash in the users ...
user avatar
0 votes
1 answer
64 views

pset7 sell.php reloads itself

My sell.php file renders sell_form.php but when I submit some stock symbol I don't get anything but reload of the same file. I can't figure out why. Can someone help me with this? // Code deleted ...
user avatar
0 votes
1 answer
108 views

pset7 sell controller issue: undefined index

I have been working at trying to fix an issue I have been having with a variable. I keep getting an error for an undefined index for value on line 49: // update cash upon selling stock query("UPDATE ...
user avatar
0 votes
1 answer
60 views

PSET7 - preg_match and one other issue

I'm right on the cusp of finishing the pset7 after marathoning it today after not having touched CS50 in about a month. I have two final issues that can't seem to be resolved. The first has to do ...
user avatar
  • 41
0 votes
1 answer
386 views

Pset7 undefined index

I'm getting this error in sell.php - Notice: Undefined index: shares in /home/jharvard/vhosts/pset7/public/sell.php on line 20 My code :- <?php // configuration require("../includes/...
user avatar
  • 17
0 votes
1 answer
314 views

pset7 sell.php doesn't sell stocks or change cash

I'm done with pset7 but my sell.php never updates the portfolio table when I sell stocks. it only displays the drop-down menu correctly where it shows the stocks bought in the list, but when i choose ...
user avatar
0 votes
1 answer
115 views

a problem with queries in sell.php

My problem is that whatever symbol I write in sell_form.php even if it doesn't exist in portfolio table, the query retursn true. Here's the query in sell.php and that's sell_form.php <form ...
user avatar
  • 76