Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
24172 Näkymät

trainers = []

for sesi in reg.event_id.session_ids :

    iden = sesi.trainer_id.identity_no

    if iden not in trainers :

          trainers.append(iden)

                        

trainer = trainers


str(trainer.encode('utf-8', 'ignore')) +'","'+str(assesor.encode('utf-8', 'ignore')) +'","' +\

Avatar
Hylkää
Paras vastaus

Hi Chaanto,

The trainers list is not string, Check the trainer type, e.g type(trainer). and  pass the return.


Avatar
Hylkää
Paras vastaus

Hello Chaanto,

Obviously list has not attribute like encode so its giving error..

You need to unicode each element of the list individually.

\https://stackoverflow.com/questions/5054333/attributeerror-list-object-has-no-attribute-encode


Thanks!

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
huhtik. 24
1726
4
marrask. 23
5739
0
lokak. 23
1475
0
jouluk. 22
2413
2
jouluk. 23
19040