No title Revision 373232623266 (Thu Oct 15 2009 at 14:45) - Diff Link to this snippet: https://friendpaste.com/4Z2bikQnCVXQ1EKh1Puq9B Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 1223415678910111213141516171819202122232425262728293031323334353637383940414243444546474849def view_rp(request, slug, envt, status, datacenter): envt_template = 'cyclo/rp_ville_'+status+'.txt' stown = Town.objects.get(slug=slug); if envt =="prod": for rp in stown.prod_rp.all(): if rp.datacenter.slug == datacenter: rpwwwip = rp.http_www rpaboip = rp.https_abo frontal_ip_list =[] for frontal in stown.prod_frontal.all(): if frontal.datacenter.slug == datacenter: frontal_ip_list.append(frontal.ip) elif envt == "preprod": for rp in stown.preprod_rp.all(): if rp.datacenter.slug == datacenter: rpwwwip = rp.http_www rpaboip = rp.https_abo frontal_ip_list =[] for frontal in stown.preprod_frontal.all(): if frontal.datacenter.slug == datacenter: frontal_ip_list.append(frontal.ip) elif envt == "vabf": for rp in stown.vabf_rp.all(): if rp.datacenter.slug == datacenter: rpwwwip = rp.http_www rpaboip = rp.https_abo frontal_ip_list =[] for frontal in stown.vabf_frontal.all(): if frontal.datacenter.slug == datacenter: frontal_ip_list.append(frontal.ip) return object_detail( request, queryset = Town.objects.all(), slug= slug, template_name = envt_template, mimetype='text/plain', extra_context = { "rpwwwip": rpwwwip, "rpaboip": rpaboip, "frontal_ip_list": frontal_ip_list, } )