Pagination, at least half of it

master
Sebastian Lohff 7 years ago
parent c520392e5e
commit 626f9fcf5d

@ -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

Loading…
Cancel
Save