def vlan_detail(request, pk): vlan = get_object_or_404(Vlan, pk=pk) return cy_detail(request, Vlan, 'vlan/vlan_detail.html', { 'Networks': 'network_set', 'Attributes': 'vlanav_set', }, pk=pk, obj=vlan)
def dynamic_intr_detail(request, pk): dynamic_interface = get_object_or_404(DynamicInterface, pk=pk) return cy_detail(request, DynamicInterface, 'dynamic_intr/dynamic_intr_detail.html', { 'Attributes': 'dynamicinterfaceav_set', }, pk=pk, obj=dynamic_interface)
def supernet_detail(request, pk): supernet = get_object_or_404(Supernet, pk=pk) networks = supernet.networks return cy_detail(request, Supernet, 'supernet/supernet_detail.html', { 'Child Networks': networks, }, obj=supernet)
def workgroup_detail(request, pk): workgroup = get_object_or_404(Workgroup, pk=pk) return cy_detail(request, Workgroup, 'workgroup/workgroup_detail.html', { 'Attributes': 'workgroupav_set', 'Dynamic Interfaces': workgroup.dynamicinterface_set.all(), 'Static Interfaces': workgroup.staticinterface_set.all(), }, obj=workgroup)
def static_intr_detail(request, pk): static_interface = get_object_or_404(StaticInterface, pk=pk) return cy_detail(request, StaticInterface, 'static_intr/static_intr_detail.html', { 'Attributes': 'staticinterfaceav_set', }, pk=pk, obj=static_interface)
def user_detail(request, pk): from cyder.base.views import cy_detail user = UserProfile.objects.get(id=pk) email = User.objects.get(id=pk).email contacts = [] form = UserPermForm() if email: contacts = (Ctnr.objects.filter(email_contact__contains=email)) else: contacts = [] ctnrs = CtnrUser.objects.filter(user_id=user) tables = { 'Containers': ctnrs, 'Contact For': contacts, } if request.user.id == user.id or request.user.is_superuser: tokens = Token.objects.filter(user=user) tables.update({'API Tokens': tokens}) return cy_detail(request, UserProfile, 'cyuser/user_detail.html', tables, obj=user, user_perm_form=form)
def vrf_detail(request, pk): from cyder.cydhcp.interface.dynamic_intr.models import DynamicInterface vrf = get_object_or_404(Vrf, pk=pk) static_intr_q = get_static_intr_q(vrf) static_intrs = (StaticInterface.objects.filter(static_intr_q) if static_intr_q else ()) networks = Network.objects.filter(vrf=vrf) sites = Site.objects.filter(network__in=networks).distinct() return cy_detail( request, Vrf, 'vrf/vrf_detail.html', { 'Dynamic Interfaces': DynamicInterface.objects.filter(range__network__vrf=vrf), 'Static Interfaces': static_intrs, 'Sites': sites, 'Networks': networks, 'Attributes': 'vrfav_set', }, pk=pk, obj=vrf)
def dynamic_intr_detail(request, pk): dynamic_interface = get_object_or_404(DynamicInterface, pk=pk) return cy_detail(request, DynamicInterface, 'cydhcp/cydhcp_detail.html', {}, pk=pk, obj=dynamic_interface)
def workgroup_detail(request, pk): workgroup = get_object_or_404(Workgroup, pk=pk) return cy_detail(request, Workgroup, 'workgroup/workgroup_detail.html', { 'Attributes': 'workgroupav_set', 'Dynamic Interfaces': workgroup.dynamicinterface_set.all(), 'Static Interfaces': workgroup.staticinterface_set.all(), 'Containers': 'ctnr_set', }, obj=workgroup)
def static_intr_detail(request, pk): static_interface = get_object_or_404(StaticInterface, pk=pk) return cy_detail(request, StaticInterface, 'cydhcp/cydhcp_detail.html', {}, pk=pk, obj=static_interface)
def vlan_detail(request, pk): return cy_detail(request, Vlan, 'cydhcp/cydhcp_detail.html', { 'Networks': 'network_set', 'Attributes': 'vlankeyvalue_set', }, pk=pk)
def network_detail(request, pk): network = get_object_or_404(Network, pk=pk) parent_networks, child_networks = calc_networks(network) return cy_detail(request, Network, 'network/network_detail.html', { 'Ranges': 'range_set', 'Parent Networks': parent_networks, 'Child Networks': child_networks, 'Attributes': 'networkkeyvalue_set', }, obj=network)
def network_detail(request, pk): network = get_object_or_404(Network, pk=pk) parent_networks, child_networks = calc_networks(network) return cy_detail(request, Network, 'network/network_detail.html', { 'Supernet': 'supernets', 'Ranges': 'range_set', 'Attributes': 'networkav_set', }, obj=network)
def site_detail(request, pk): obj = get_object_or_404(Site, pk=pk) networks = Network.objects.filter(site=obj) return cy_detail(request, Site, 'site/site_detail.html', { 'Networks': networks, 'Attributes': 'siteav_set', 'Children Sites': 'site_set', 'Vlanless Networks': networks.filter(vlan__isnull=True) }, obj=obj)
def soa_detail(request, pk): from cyder.base.views import cy_detail soa = SOA.objects.get(id=pk) return cy_detail(request, SOA, 'soa/soa_detail.html', { 'domains': (soa.domain_set.filter(is_reverse=False) .order_by('master_domain').select_related()), 'rdomains': (soa.domain_set.filter(is_reverse=True) .order_by('master_domain').select_related()), 'attributes': SOAAV.objects.filter(entity=soa.id) }, obj=soa)
def vrf_detail(request, pk): vrf = get_object_or_404(Vrf, pk=pk) return cy_detail(request, Vrf, 'cydhcp/cydhcp_detail.html', { 'Dynamic Hosts': 'dynamicinterface_set', 'Static Hosts': 'staticinterface_set', 'Attributes': 'vrfkeyvalue_set', }, pk=pk)
def domain_detail(request, pk): return cy_detail(request, Domain, 'cydns/cydns_detail.html', { 'Interfaces': 'staticinterface_set', 'Address Records': 'addressrecord_set', 'CNAMEs': 'cname_set', 'MXs': 'mx_set', 'Nameservers': 'nameserver_set', 'PTRs': 'reverse_ptr_set', 'SRVs': 'srv_set', 'SSHFPs': 'sshfp_set', 'TXTs': 'txt_set', }, pk=pk)
def vrf_detail(request, pk): vrf = get_object_or_404(Vrf, pk=pk) return cy_detail( request, Vrf, "cydhcp/cydhcp_detail.html", { "Dynamic Hosts": "dynamicinterface_set", "Static Hosts": "staticinterface_set", "Attributes": "vrfkeyvalue_set", }, pk=pk, )
def site_detail(request, pk): obj = get_object_or_404(Site, pk=pk) networks = Network.objects.filter(site=obj) return cy_detail( request, Site, 'site/site_detail.html', { 'Networks': networks, 'Attributes': 'siteav_set', 'Children Sites': 'site_set', 'Vlanless Networks': networks.filter(vlan__isnull=True) }, obj=obj)
def vrf_detail(request, pk): from cyder.cydhcp.interface.dynamic_intr.models import DynamicInterface vrf = get_object_or_404(Vrf, pk=pk) static_intr_q = get_static_intr_q(vrf) static_intrs = ( StaticInterface.objects.filter(static_intr_q) if static_intr_q else ()) return cy_detail(request, Vrf, 'vrf/vrf_detail.html', { 'Dynamic Interfaces': DynamicInterface.objects.filter( range__network__vrf=vrf), 'Static Interfaces': static_intrs, 'Attributes': 'vrfav_set', }, pk=pk, obj=vrf)
def soa_detail(request, pk): from cyder.base.views import cy_detail soa = SOA.objects.get(id=pk) return cy_detail( request, SOA, 'soa/soa_detail.html', { 'domains': (soa.domain_set.filter( is_reverse=False).order_by('master_domain').select_related()), 'rdomains': (soa.domain_set.filter( is_reverse=True).order_by('master_domain').select_related()), 'attributes': SOAAV.objects.filter(entity=soa.id) }, obj=soa)
def address_record_detail(request, pk): return cy_detail( request, AddressRecord, 'cydns/cydns_detail.html', {}, pk=pk)