def service_detail(request, service_id):
 service = get_object_or_404(Service, pk=service_id)
 layer_list = service.layer_set.all()
 service_list = service.service_set.all()
 service_paginator = Paginator(service_list, 25)
 layer_paginator = Paginator(layer_list, 25)
 page = request.GET.get('page')
 try:
  layers = layer_paginator.page(page)
 except PageNotAnInteger:
  layers = layer_paginator.page(1)
 except EmptyPage:
  layers = layer_paginator.page(layer_paginator.num_pages)
 try:
  services = service_paginator.page(page)
 except PageNotAnInteger:
  services = service_paginator.page(1)
 except EmptyPage:
  services = service_paginator.page(service_paginator.num_pages)
 return render_to_response('services/service_detail.html', RequestContext(request, {'service': service, 'layers': layers, 'services': services, 'permissions_json': _perms_info_json(service)}))

def service_detail ( request , service_id ) : service = get_object_or_404 ( Service , pk = service_id ) layer_list = service . layer_set . all ( ) service_list = service . service_set . all ( ) service_paginator = Paginator ( service_list , 25 ) layer_paginator = Paginator ( layer_list , 25 ) page = request . GET . get ( 'page' ) try : layers = layer_paginator . page ( page ) except PageNotAnInteger : layers = layer_paginator . page ( 1 ) except EmptyPage : layers = layer_paginator . page ( layer_paginator . num_pages ) try : services = service_paginator . page ( page ) except PageNotAnInteger : services = service_paginator . page ( 1 ) except EmptyPage : services = service_paginator . page ( service_paginator . num_pages ) return render_to_response ( 'services/service_detail.html' , RequestContext ( request , { 'service' : service , 'layers' : layers , 'services' : services , 'permissions_json' : _perms_info_json ( service ) } ) )
this view shows the details of a service .