dnmapper/bgpdata/views.py

14 lines
496 B
Python
Raw Normal View History

2015-03-23 01:42:31 +01:00
from django.shortcuts import render
2015-03-27 15:33:54 +01:00
from bgpdata.models import CrawlRun, AS, Peering
2015-03-23 01:42:31 +01:00
2015-03-27 15:33:54 +01:00
def overview(request):
crawls = CrawlRun.objects.order_by("-startTime")
return render(request, 'bgpdata/overview.html', {"crawls": crawls})
def showMap(request, crawlId):
crawl = CrawlRun.objects.get(id=crawlId)
ASses = AS.objects.filter(crawl=crawl)
peerings = Peering.objects.filter(as1__crawl=crawl)
return render(request, 'bgpdata/map.html', {"crawl": crawl, 'ASses': ASses, 'peerings': peerings})