问题:
>> models.Foo.objects.all()
>> [<Foo: [Bad Unicode data]>]
解决办法:
更改 model 的 __unicode__
方法:
# Before
def __unicode__(self):
return '%s' % self.get_foo_display() # it's bad
# To
def __unicode__(self):
return u'%s' % self.get_foo_display() # it's Ok
Comments