coercing to Unicode: need string or buffer, Task found

Цікаву САБЖ помилку дебажив.
class Task(models.Model):
name = models.CharField(max_length=120)
description = models.TextField()
price = models.DecimalField(max_digits=5, decimal_places=2)
buyer = models.ForeignKey(User, related_name='buyer')
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
def __unicode__(self):
return self.name

class TaskStatus(models.Model):
POSTED, ASSIGNED, COMPLETED, CLOSED = range(1,5)
TASK_STATUS_VALUES = (
(POSTED, 'Posted'),
(ASSIGNED, 'Assigned'),
(COMPLETED, 'Completed'),
(CLOSED, 'Closed'),
)
task = models.ForeignKey(Task)
task_status = models.IntegerField(choices=TASK_STATUS_VALUES, blank=True, null=True)
provider = models.ForeignKey(User, blank=True, null=True)
created_at = models.DateTimeField(auto_now_add=True)
def __unicode__(self):
return self.task


лікується:
    def __unicode__(self):
return unicode(self.task)

Немає коментарів: