当我在 ssh 服务器上运行 django 项目时,出现以下错误
coercing to Unicode: need string or buffer, User found.
这是我的 models.py 文件
class Employee(models.Model):
user = models.OneToOneField(User)
address = models.CharField(max_length=200, blank=True)
name = models.CharField(max_length=200, blank=True)
designation = models.CharField(max_length=20, blank=True, choices=
DESIGNATION_CHOICES)
project = models.CharField(max_length=50, blank=True)
task = models.CharField(max_length=50, blank=True)
image = models.ImageField(upload_to="media/images/", blank=True)
def __unicode__(self):
return self.user
这里有什么错误?