Reputation: 575
How to display IntegerField in django admin?
My error: coercing to Unicode: need string or buffer, int found
class Day(models.Model):
day = models.IntegerField()
def __unicode__(self):
return self.day
Upvotes: 3
Views: 2731
Reputation: 12641
you need to return a string, not an integer. like this:
return str(self.day)
Upvotes: 8