Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
sell.py questions regarding form retrieval of drop down list values
Post Flair (click to view more posts with a particular flair)
Post Body

Hello,

I am working on the application.py sell function and I am trying to allow a user to choose a stock and amount of shares to sell by displaying a table like the one in index.html that uses a radio button and drop down list for the user to choose what they want to sell like this. I am trying to pass the value chosen from the drop down list to my application, but when I test it by passing the values the user POSTed on a test.html page by using "request.form.get("shares_to_sell")" I get "None" for the drop down list value. Does anyone know how to properly get the value chosen from the drop down list so I can use it in application.py? Here is my html code for the option values below:

{% for i in range(stock["shares"]   1) %}
          <option name="shares_to_sell" value="{{ i }}">{{ i }}</option>
{% endfor %}    

Author
Account Strength
80%
Account Age
11 years
Verified Email
Yes
Verified Flair
No
Total Karma
301
Link Karma
66
Comment Karma
235
Profile updated: 4 days ago
Posts updated: 1 year ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
7 years ago