def server_group_field_data(request):
 server_groups = server_group_list(request)
 if server_groups:
  server_groups_list = [(sg.id, sg.name) for sg in server_groups]
  server_groups_list.sort(key=(lambda obj: obj[1]))
  return ([('', _('Select Server Group'))] + server_groups_list)
 return [('', _('No server groups available'))]

def server_group_field_data ( request ) : server_groups = server_group_list ( request ) if server_groups : server_groups_list = [ ( sg . id , sg . name ) for sg in server_groups ] server_groups_list . sort ( key = ( lambda obj : obj [ 1 ] ) ) return ( [ ( '' , _ ( 'Select Server Group' ) ) ] + server_groups_list ) return [ ( '' , _ ( 'No server groups available' ) ) ]
returns a list of tuples of all server groups .