4
unicode(self)not working for me。我仍然可以在管理员中看到'名称对象'。我的代码如下:Python 2.7__unicode __(self)not working
import datetime # standard python datetime module
from django.db import models # Djangos time-zone-related utilities
from django.utils import timezone
class Name(models.Model):
name = models.CharField(max_length=200)
def __unicode__(self): # Python 3: def __str__(self):
return self.name
感谢你
感谢。新手在这里! – 2013-05-07 06:17:12
@ImranOmarBukhsh如果您可以点击答案左侧的投票计数器下的复选标记,我将非常感激。这表明这个问题已经得到了充分的回答,我们都得到了额外的代表! – 2013-05-07 07:36:32
我一直试图做到这一点,只要你把答案,但堆栈溢出不允许我。谢谢。 – 2013-05-08 10:22:55