Newer
Older
#!/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" )
all_detection_technics = config.db.query_fetchall( "SELECT * FROM detection_technics ORDER BY name ASC" )
surfaces = config.db.query_fetchall( "SELECT * FROM surfaces ORDER BY name ASC" )
for _, v in enumerate( marks ):
for col in [ "detection_technic", "surface" ]:
for old in "{}":
try:
v[ col ] = v[ col ].replace( old, "" )
except:
pass
return my_render_template(
"trainer/search.html",
marks = marks,
all_detection_technics = all_detection_technics,
surfaces = surfaces