def search():
name = request.args.get('name')
if not name.isalpha():
print('Not isalpha string')
return redirect(request.referrer)
bdays = (Birthday.query
.filter(Birthday.name.like("%{}%".format(name)))
.order_by(asc(Birthday.bday)).all())
now = _get_current_date()
title = 'Search'
tabs = [title] + TABS[1:]
return render_template("index.html",
data=bdays,
now=now,
active_tab=title,
tabs=tabs)
评论列表
文章目录