def index(): log_control.logging.debug("/.index: Started.") pagetitle = "Kindleセール通知 管理画面" text = "Kindleセール通知 管理画面" item_list_msg = "セール通知済みアイテム" # 登録済みアイテムを格納する変数を用意 item_list = "" # SQLite実行用のインスタンスを生成 sql = SqlQuery() # セール通知済みのアイテムリストを取得 try: sale_noticed_result = sql.sale_noticed_item() except: raise for id,asin,title,price,discount_rate,flag in sale_noticed_result: # ASIN番号からWebページURLを生成 url = base_url + asin + "/" item_list = item_list + "<tr><td><a href=" + url + ">" + title + "</a></td>" \ "<td>" + str(price) + "</td>" \ "<td>" + str(discount_rate) + "</td></tr>\n" return render_template('index.html', text=text, pagetitle=pagetitle, item_list_msg=item_list_msg, item_list=item_list)