Commit 2686cc16 authored by Stauros Kroustouris's avatar Stauros Kroustouris

show access switches too

parent b27d2775
......@@ -2,7 +2,8 @@
import json
from django.http import HttpResponse
from django.core.urlresolvers import reverse
from network.models import PeerIfces, PeerSite, Location
from django.shortcuts import get_object_or_404
from network.models import PeerIfces, PeerSite, Location, Ifce, Peer
from utils import (
......@@ -12,9 +13,20 @@ from utils import (
def peer_ifces(request, peer_id):
ifces = PeerIfces.objects.filter(peer__peer_id=peer_id)
peer = get_object_or_404(Peer, peer_id=peer_id)
response = []
for ifce in ifces:
ifces = Ifce.objects.filter(description__contains=peer.peer_tag).filter(description__contains='PTSAL').exclude(name__contains='.')
for ifce in ifces:
'site': ifce.description.split('[')[1].split('-')[0]
json_str = json.dumps(response)
return HttpResponse(
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment