تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
24138 أدوات العرض

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')) +'","' +\

الصورة الرمزية
إهمال
أفضل إجابة

Hi Chaanto,

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


الصورة الرمزية
إهمال
أفضل إجابة

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!

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
أبريل 24
1716
4
نوفمبر 23
5706
0
أكتوبر 23
1450
0
ديسمبر 22
2395
2
ديسمبر 23
19008