def _get_valid_name(proposed_name):
 slug_name = slugify(proposed_name)
 name = slug_name
 if (len(slug_name) > 40):
  name = slug_name[:40]
 existing_service = Service.objects.filter(name=name)
 iter = 1
 while (existing_service.count() > 0):
  name = (slug_name + str(iter))
  existing_service = Service.objects.filter(name=name)
  iter += 1
 return name

def _get_valid_name ( proposed_name ) : slug_name = slugify ( proposed_name ) name = slug_name if ( len ( slug_name ) > 40 ) : name = slug_name [ : 40 ] existing_service = Service . objects . filter ( name = name ) iter = 1 while ( existing_service . count ( ) > 0 ) : name = ( slug_name + str ( iter ) ) existing_service = Service . objects . filter ( name = name ) iter += 1 return name
return a unique slug name for a service .