Во view помещен SelectField со списком выбора. Список выбора определяется тут:
@app.route('/' , methods=['GET','POST']) def show_main(): db = get_db() authors_books = execute_db('''select book_title, author_name FROM authors_books order by book_title''', db) books = execute_db('''select book_title FROM books order by book_title''', db) authors = execute_db('''select author_name FROM authors order by author_name''', db) form = AddInLibForm() choices = [] for author in authors: choices.append(str(author)) form.select_author.choices = choices
Вот view:
<form action="" method=get name="add_in_lib_form"> {{form.hidden_tag()}} <dl> <select title="Select author:"> {% for author in form.select_author.choices %} <option value={{ author }}>{{ author }}</option> {% endfor %} </select> <select title="Select book:"> {% for book in form.select_book.choices %} <option value={{ book }}>{{ book }}</option> {% endfor %} </select> <dd><input type=submit value=Add> </dl> </form>
В итоге на форме отображается список выбора со значениями типа sqlite3.Row object at 0x000000033BB
Подскажите, пожалуйста, что я делаю не так…