Reputation: 2168
use python3 and Django1.8 admin.py to manage DB:
class Employee(models.Model):
name = models.CharField(max_length=20)
sex = models.CharField(max_length=1,choices=sex_choices)
def __unicode__(self):
return self.name
i want return object's name,so i use __unicode__(self)
return self.name
but result:
it's only show object ,not the name!!!!
what should i do??
Upvotes: 7
Views: 2488