def organization_autocomplete(context, data_dict):
 _check_access('organization_autocomplete', context, data_dict)
 q = data_dict['q']
 limit = data_dict.get('limit', 20)
 model = context['model']
 query = model.Group.search_by_name_or_title(q, group_type=None, is_org=True)
 organization_list = []
 for organization in query.all():
  result_dict = {}
  for k in ['id', 'name', 'title']:
   result_dict[k] = getattr(organization, k)
  organization_list.append(result_dict)
 return organization_list

def organization_autocomplete ( context , data_dict ) : _check_access ( 'organization_autocomplete' , context , data_dict ) q = data_dict [ 'q' ] limit = data_dict . get ( 'limit' , 20 ) model = context [ 'model' ] query = model . Group . search_by_name_or_title ( q , group_type = None , is_org = True ) organization_list = [ ] for organization in query . all ( ) : result_dict = { } for k in [ 'id' , 'name' , 'title' ] : result_dict [ k ] = getattr ( organization , k ) organization_list . append ( result_dict ) return organization_list
return a list of organization names that contain a string .