0

I have question with displaying values from stock structure that returns by lookup - name and symbol are the same.
Here is how quoted.html is called

#ask for stock
stock_symbol = lookup(request.form.get("symbol"))

#get quoted for the user
return render_template("quoted.html", stock = stock_symbol)

Here is quoted.html

{%block main %}
    <p>Price for {{ stock.name }} ({{ stock.symbol }})  is {{ stock.price }} </p>
{% endblock %}

And result for example for Verizon will be:
enter image description here

Is this correct that name == symbol?Shouldn't there be full name 'Verizon' instead of 'VZ'?Is it problem somwhere in code or it depends on data in CSV file from helpers(sorry, but i'm not managed how to check in inside this csv file)

Regards,

1 Answer 1

1

The API that is being called doesn't return the name, so for backwards compatibility (for those parts of the code that were written when the Yahoo Finance API was being used), the symbol is put into the name.

So what you see is expected.

2
  • So what's the solution for this? Because the requirements of 'quotes' is for the name, price, and symbol to be returned.
    – NotABot
    Dec 10, 2017 at 10:25
  • In my case I had to add "name" to the return function in the helpers.py file. Apr 19, 2018 at 9:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .