when using "self.content_type" within "__unicode__" on one of my
models, I´m not getting the right ContentType. instead of getting the
reference to _another_ model, I´m always getting the current model.
an example:
class ContainerListItem(models.Model):
containerlist = models.ForeignKey(ContainerList)
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField('ID')
content_object = generic.GenericForeignKey('content_type',
'object_id')
....
class Meta:
....
def __unicode__(self):
print self.content_type
...
in my database, the value for content_type is "10" (which is the ID of
the model "movies"). but, instead of "10", I´m getting "44", which is
the ID of the model "ContainerListItem".
I´m probably missing something here, but the reference to ContentType
is working on my website. It´s just not possible to use that reference
for the models representation ... this is spooky.
thanks,
patrick
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---