我有以下内容:
from django.db import models
class Category(models.Model):
name = models.CharField(max_length=200)
def _unicode_(self):
return self.name
class Item(models.Model):
category = models.ForeignKey(Category)
dateadded = models.DateTimeField('date added')
name = models.CharField(max_length=200)
description = models.TextField()
quantity = models.IntegerField()
我的问题是这def _unicode_(self)
不起作用。有任何想法吗?