views.py 文件源码

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

项目:RPKI-toolkit 作者: pavel-odintsov 项目源码 文件源码
def route_view(request):
    """
    Display a list of global routing table entries which match resources
    listed in received certificates.

    """
    conf = get_conf(request.user, request.session['handle'])
    count = request.GET.get('count', 25)
    page = request.GET.get('page', 1)

    paginator = Paginator(conf.routes, count)
    try:
        routes = paginator.page(page)
    except InvalidPage:
        # page was empty, or page number was invalid
        routes = []
    ts = dict((attr['name'], attr['ts']) for attr in models.Timestamp.objects.values())
    return render(request, 'app/routes_view.html',
                  {'routes': routes, 'timestamp': ts})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号