Try to add __unicode__ method to your SmartBuy model that returns string. On Mon, May 9, 2011 at 10:32 AM, chhots <bayasa...@gmail.com> wrote:
> class Like(models.Model): > smartbuy = models.ForeignKey(SmartBuy) > User = models.ForeignKey(User) > def __unicode__(self): > return self.smartbuy or “Smartbuy #%d” % self.smartbuy > i have this model which is both fields are foreign key from other > table and when i tri to add some in this model through djnago admin > its showing this error > > Caught TypeError while rendering: coercing to Unicode: need string or > buffer, NoneType found > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.