def list_runs(request):
    "list all the runs that have been made so far"
    runs = get_list_or_404(Run)
    
    paginator = Paginator(runs, 10) # Show 10 runs per page

    # Make sure page request is an int. If not, deliver first page.
    try:
        page = int(request.GET.get('page', '1'))
    except __HOLE__:
        page = 1

    # If page request (9999) is out of range, deliver last page of results.
    try:
        run_list = paginator.page(page)
    except (EmptyPage, InvalidPage):
        run_list = paginator.page(paginator.num_pages)
    
    context = {
        'runs': run_list,
    }
    return render_to_response('list_runs.html', context,
        context_instance=RequestContext(request))
dataset/ETHPy150Open garethr/Asteroid/asteroid/apps/runner/views.py/list_runs