KankenOnline/kanken_online/search.py

17 lines
547 B
Python
Raw Normal View History

from flask import Blueprint, render_template, request
2024-10-14 11:15:47 +00:00
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"])
2024-10-14 11:15:47 +00:00
@blueprint.route("/")
def search_page():
if request.args:
return search_results(request.args)
2024-10-14 11:17:52 +00:00
return render_template("search/search.html")