KankenOnline/kanken_online/search.py
2024-10-14 12:33:37 +01:00

17 lines
547 B
Python

from flask import Blueprint, render_template, request
blueprint = Blueprint("search", __name__, url_prefix="/search")
def search_results(args: dict):
class renderable:
def render(self):
return "ok"
results = [renderable(), renderable()] # Do something with args
return render_template("search/search_results.html", results=results, value=args["keywords"])
@blueprint.route("/")
def search_page():
if request.args:
return search_results(request.args)
return render_template("search/search.html")