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