I would like to use the user's data as a value in SelectField. I am trying to create a list of things the user has added to the database, then the user can see what they have added. So it should loop through the database and list the items the user has chosen. The user can then see what they have listed and be able to edit the SelectField at their choosing.
# Ingredients Form
ITEM_AMOUNT = [(0, "-"), (1, "1/4"), (2, "1/2"), (3, "1/3"), (4, "1/8"), (5, "1"), (6, "2"),
(7, "3"), (8, "4"), (9, "5"), (10, "6")]
class ListForm(FlaskForm):
item = SelectField("Amount", choices=ITEM_AMOUNT)
# CSS
{% extends 'base.html' %}
{% block content %}
<form action="/dashboard" method="Post">
{{ form.hidden_tag() }}
{% for choice in list %}
{{ form.item(class="form-select", placeholder=dict(form.item.choices).get(form.item.data))
}}
{% endfor %}
{% endblock %}