From 626f9fcf5d40538885c1d8e74015c16899886312 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Sat, 14 Jan 2017 00:15:21 +0100 Subject: [PATCH] Pagination, at least half of it --- bgpdata/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bgpdata/views.py b/bgpdata/views.py index 548ea8e..4f6a6bd 100644 --- a/bgpdata/views.py +++ b/bgpdata/views.py @@ -1,9 +1,11 @@ from django.shortcuts import render from bgpdata.models import CrawlRun, AS, Peering +from django.core.paginator import Paginator def overview(request): crawls = CrawlRun.objects.order_by("-startTime") - return render(request, 'bgpdata/overview.html', {"crawls": crawls}) + crawlsPage = Paginator(crawls, 20) + return render(request, 'bgpdata/overview.html', {"crawls": crawlsPage.page(1)}) def showMap(request, crawlId): crawl = None