def register_service_by_type(request):
 url = request.POST.get('url')
 type = request.POST.get('type')
 url = _clean_url(url)
 services = Service.objects.filter(base_url=url)
 if (services.count() > 0):
  return
 (type, server) = _verify_service_type(url, type)
 if ((type == 'WMS') or (type == 'OWS')):
  return _process_wms_service(url, type, None, None, wms=server)
 elif (type == 'REST'):
  return _register_arcgis_url(url, None, None, None)

def register_service_by_type ( request ) : url = request . POST . get ( 'url' ) type = request . POST . get ( 'type' ) url = _clean_url ( url ) services = Service . objects . filter ( base_url = url ) if ( services . count ( ) > 0 ) : return ( type , server ) = _verify_service_type ( url , type ) if ( ( type == 'WMS' ) or ( type == 'OWS' ) ) : return _process_wms_service ( url , type , None , None , wms = server ) elif ( type == 'REST' ) : return _register_arcgis_url ( url , None , None , None )
register a service based on a specified type .