Browse Source

Pagination, at least half of it

Sebastian Lohff 3 years ago
parent
commit
626f9fcf5d
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      bgpdata/views.py

+ 3
- 1
bgpdata/views.py View File

@@ -1,9 +1,11 @@
1 1
 from django.shortcuts import render
2 2
 from bgpdata.models import CrawlRun, AS, Peering
3
+from django.core.paginator import Paginator
3 4
 
4 5
 def overview(request):
5 6
 	crawls = CrawlRun.objects.order_by("-startTime")
6
-	return render(request, 'bgpdata/overview.html', {"crawls": crawls})
7
+	crawlsPage = Paginator(crawls, 20)
8
+	return render(request, 'bgpdata/overview.html', {"crawls": crawlsPage.page(1)})
7 9
 
8 10
 def showMap(request, crawlId):
9 11
 	crawl = None

Loading…
Cancel
Save