1👍
If you use Python 2 (and it seems that you do) you should use __unicode__
instead of __str__
, for example:
def __unicode__(self):
return self.state
This will solve your problems with encoding.
In Python 3 however __str__
in the way to go (because the devision between normal strings and unicode strings doesn’t exist in Python 3).
Source:stackexchange.com