handler.py 文件源码

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

项目:icfpc2016-judge 作者: icfpc2016 项目源码 文件源码
def problem_list_handler():
    try:
        page = int(bottle.request.query.get('page', 1))
    except ValueError:
        page = 1
    count = model.count_public_problems()
    problems = model.get_public_problems(
        limit=FLAGS.pagination_items_per_page,
        skip=(page - 1) * FLAGS.pagination_items_per_page)
    team_display_name_map = handler_util.compute_team_display_name_map(
        problem['owner'] for problem in problems)
    pagination = handler_util.Pagination(
        page, FLAGS.pagination_items_per_page, count)
    template_dict = {
        'problems': problems,
        'team_display_name_map': team_display_name_map,
        'pagination': pagination,
    }
    return handler_util.render('problem_list.html', template_dict)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号