#!/usr/bin/python # -*- coding: UTF-8 -*- from flask import Blueprint import json import config from utils.decorator import login_required from utils.template import my_render_template trainer_view = Blueprint( "trainer", __name__, template_folder = "templates" ) @trainer_view.route( "/trainer/search" ) @login_required def search(): """ Provide the search page. """ marks = config.db.query_fetchall( "SELECT * FROM mark_info" ) dt = config.db.query_fetchall( "SELECT * FROM detection_technics" ) surfaces = config.db.query_fetchall( "SELECT * FROM surfaces" ) for _, v in enumerate( marks ): for col in [ "detection_technic", "surface" ]: for old in "{}": v[ col ] = v[ col ].replace( old, "" ) return my_render_template( "trainer/search.html", marks = marks, dt = dt, surfaces = surfaces )