Hey all,
I am a beginner django user. I am going through the tutorial, but when
I post the following I get the TypeError: coercing to unicode:
class Phone(models.Model):
phonenumber = models.IntegerField()
pub_date = models.DateTimeField('date published')
def __unicode__(self):
return self.phonenumber
class Device(models.Model):
phone = models.ForeignKey(Phone)
carrier = models.CharField(max_length=200)
modelnumber = models.CharField(max_length=200)
def __unicode__(self):
return self.carrier
I've tried other solutions posted by others, such as, change return
self.carrier to return unicode(self.carrier), but Im still getting the
error when I do this.
Any suggestions? I would greatly appreciate it.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.