Pagination, at least half of it

This commit is contained in:
Sebastian Lohff 2017-01-14 00:15:21 +01:00
parent c520392e5e
commit 626f9fcf5d
1 changed files with 3 additions and 1 deletions

View File

@ -1,9 +1,11 @@
from django.shortcuts import render from django.shortcuts import render
from bgpdata.models import CrawlRun, AS, Peering from bgpdata.models import CrawlRun, AS, Peering
from django.core.paginator import Paginator
def overview(request): def overview(request):
crawls = CrawlRun.objects.order_by("-startTime") 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): def showMap(request, crawlId):
crawl = None crawl = None