I am trying to write into a file (in Python), but it says:
'ManyRelatedManager' object has no attribute 'encode'
Here is the code:
self.writer.writerow([s.encode('utf-8') for s in row])
Is there a way to avoid/fix this ?
I am trying to write into a file (in Python), but it says:
'ManyRelatedManager' object has no attribute 'encode'
Here is the code:
self.writer.writerow([s.encode('utf-8') for s in row])
Is there a way to avoid/fix this ?
in your code
self.writer.writerow([s.encode('utf-8') for s in row])
the "s" object may not a unicode object you should try change your "s" object to unicode first