Esempio n. 1
0
def top10(request):
    # [
    #     (post1, 100),
    #     (post2, 99),
    #     (post3, 90),
    # ]
    rank_data = get_top_n(10)
    return render(request, 'top10.html', {'rank_data': rank_data})
Esempio n. 2
0
def top10(request):
    # rank_data = [
    #     [Post(1), 10],
    #     [Post(3), 9],
    #     [Post(2), 5],
    # ]
    rank_data = get_top_n(10)
    return render(request, 'top10.html', {'rank_data': rank_data})
Esempio n. 3
0
def top10(request):
    '''
    1. aaaa 30
    2. bbbb 27
    3. cccc 19
    '''
    rank_data = get_top_n(10)
    return render(request, 'top10.html', {'rank_data': rank_data})
Esempio n. 4
0
def top10(request):
    # rank_data = [
    #     [<Post(37)>,  100],
    #     [<Post(18)>,   94],
    #     [<Post(22)>,   71],
    # ]
    rank_data = get_top_n(10)
    return render(request, 'top10.html', {'rank_data': rank_data})
Esempio n. 5
0
def top10(request):
    '''显示阅读量最高的前 10 篇文章'''
    # rank_data = [
    #     [<Post(10)>, 30],
    #     [<Post(21)>, 19],
    #     [<Post(15)>,  7],
    # ]
    rank_data = get_top_n(10)
    return render(request, 'top10.html', {'rank_data': rank_data})
Esempio n. 6
0
def top10(request):
    '''
    rank_data = [
        [<Post(33)>, 758],
        [<Post( 1)>, 357],
        [<Post(29)>, 212],
    ]
    '''
    rank_data = get_top_n(10)
    return render(request, 'top10.html', {'rank_data': rank_data})
Esempio n. 7
0
def top10(request):
    '''
    rank_data = [
        [<Post(37)>, 128],
        [<Post(32)>,  96],
        [<Post(25)>,  89],
        [<Post(11)>,  71],
    ]
    '''
    rank_data = get_top_n(10)
    return render(request, 'top10.html', {'rank_data': rank_data})
Esempio n. 8
0
def top10(request):
    """
     rank_data = [
         [<Post(37)>, 128],
         [<Post(32)>,  96],
         [<Post(25)>,  89],
         [<Post(11)>,  71],
     ]
     """
    rank_data = get_top_n(10)
    return render(request, "bbs/post/top10.html", {"rank_data": rank_data})
Esempio n. 9
0
def top10(request):
    '''
    排名 文章名                  阅读量
    1   "The Zen of Python-32"  1000
    2   "The Zen of Python-13"  900
    3   "The Zen of Python-34"  879
    4   "The Zen of Python-1"   767
    5   "The Zen of Python-9"   646
    6   "The Zen of Python-6"   432
    7   "The Zen of Python-22"  321
    8   "The Zen of Python-17"  121
    9   "The Zen of Python-31"  90
    10  "The Zen of Python-21"  71
    '''
    post_rank = get_top_n(10)
    return render(request, 'top10.html', {'rank_data': post_rank})
Esempio n. 10
0
def top10_post(request):
    rand_data = get_top_n(10)
    return render(request, 'top10.html', {'rand_data': rand_data})