Пример #1
0
def rank(request):
    profiles = TeamProfile.objects.all().filter(activation_key='ALREADY_ACTIVATED').order_by('-rank','last_submit')

    return render_to_response('rank/rank.html',
                              paginator(request, profiles, settings.RANK_PER_PAGE),
                              context_instance=RequestContext(request)
                              )
Пример #2
0
def challenge_choice(request):
    challenges = ChoiceChallenge.objects.all()

    # 获得当前团队已完成的题目列表
    profile = request.user.get_profile()
    cur_fin_chall = str(profile.finished_choices)

    data = paginator(request, challenges, settings.CHALL_PER_PAGE)

    data['cur_fin_chall'] = cur_fin_chall

    return render_to_response('challenge/choice.html',
                              data,
                              context_instance=RequestContext(request))
Пример #3
0
def challenge(request):
    challenges = Challenge.objects.filter(is_shown=True)

    # 获得当前团队已完成的题目列表
    profile = request.user.get_profile()
    cur_fin_chall = str(profile.finished_challenges)

    has_choice = ChoiceChallenge.objects.exists()

    data = paginator(request, challenges, settings.CHALL_PER_PAGE)

    data['has_choice'] = has_choice
    data['cur_fin_chall'] = cur_fin_chall

    return render_to_response('challenge/index.html',
                              data,
                              context_instance=RequestContext(request))
Пример #4
0
def notice(request):
    notices = Notice.objects.filter(is_shown=True).order_by('-update_date','pub_date')

    return render_to_response('home/notices.html',
                              paginator(request, notices, settings.NOTICE_PER_PAGE),
                              context_instance=RequestContext(request))