示例#1
0
文件: views.py 项目: tstrinity/chess
def index(request):
    info  = Tournament.get_all_info(started=True)
    paginator = Paginator(info, 12)
    page = request.GET.get('page')
    try:
        info = paginator.page(page)
    except PageNotAnInteger:
        info = paginator.page(1)
    except EmptyPage:
        info = paginator.page(paginator.num_pages)
    return render_to_response('tournament/index.html',
        {'info' :info},
        context_instance=RequestContext(request)
    )
示例#2
0
文件: views.py 项目: tstrinity/chess
def index(request):
    tournaments = Tournament.get_all_info(True)
    return render_to_response("index.html", {"tournaments": tournaments}, context_instance=RequestContext(request))
示例#3
0
文件: views.py 项目: tstrinity/chess
def index_inactive(request):
    print 'index_inactive'
    return render_to_response('tournament/inactive.html',
        {'info' : Tournament.get_all_info(started=False)},
        context_instance=RequestContext(request)
    )