app.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:bday-app 作者: pybites 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号