【发布时间】:2011-01-09 03:54:59
【问题描述】:
我的 django 应用程序中有以下代码。
class Status(object):
def __init__(self, id, desc):
self.id = id
self.desc = desc
def __unicode__(self):
return self.desc
STATUS = Status(0, _(u"Some text"))
当我尝试显示某些状态(甚至将其强制为 unicode)时,我得到:
TypeError: coercing to Unicode: need string or buffer, __proxy__ found
谁能解释一下,我做错了什么?
【问题讨论】:
标签: python django unicode gettext