예제 #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)
    )