On Mon, Jul 20, 2009 at 8:30 PM, sjtirtha <sjtir...@gmail.com> wrote:

>
> class ContentAssoc(models.Model):
>     object_a = models.PositiveIntegerField()
>     type_a = models.ForeignKey(ContentType, related_name='type_a')
>     object_b = models.PositiveIntegerField()
>     type_b = models.ForeignKey(ContentType, related_name='type_b')
>
>     class Meta:
>         unique_together = ('object_a', 'type_a', 'object_b', 'type_b')
>
>     def __unicode__(self):
>         return self.type_a
>

The __unicode__ method expects a unicode value to be returned. Try: return
unicode(self.type_a)

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to