So, let's say that I have this list written on my main Flask app:
calculations = ['Summary', 'Average', 'Minimal Value', 'Maximum Value', 'Median', 'Count', 'Standard Deviation']
I have a template which goes like this:
@app.route('/analyze.html')
def analyze():
return render_template('analyze.html', name=calculations)
And on the template, I wrote:
<select class="form-control" name="calculations">
{% for calc in calculations %}
<option value="{{ calc }}">{{ calc }}</option>
{% endfor %}
</select>
I want to show the calculations list into the select options on the HTML template so it can chooses one of the calculations. When I tried this way, it displayed nothing on the option list.
How should i do this?
calculations=calculations?