Hi All,
Having some problem with foreign key and admin interface :
#models---------------------------------------------------------------------------------------
class tagword(models.Model):
name = models.CharField(max_length=50)
def __unicode__(self):
return self.name
class Admin:
pass
class Meta:
ordering = ["name"]
app_label = 'common_utils'
class tag(models.Model):
tagword = models.ForeignKey(tagword)
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
content_object = generic.GenericForeignKey()
def __unicode__(self):
return self.tagword
class Admin:
pass
class Meta:
ordering = ["tagword"]
app_label = 'common_utils'
#------------------------------------------------------------------------------------------------
I get the following error while I try to access /admin/common_utils/tag/
TypeError at /admin/common_utils/tag/
coercing to Unicode: need string or buffer, tagword found
What is my mistake?
Thanks in advance
Regards Ganesh
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---