Jacob Kaplan-Moss wrote:
> Try this::
>
> from innovate.innovation.models import Innovation
> from django.contrib.contenttypes.models import ContentType
>
> i = Innovation.objects.get(id=1)
> ct = ContentType.objects.get_for_model(i)
Yeah, that's not so hard. I updated my method to this and it worked
just fine.
def get_content_type(self):
return ContentType.objects.get_for_model(self)
Thanks.
Besides the suggestion that this might be a good inclusion to
models.Model, I guess this should have gone to django-users.
-Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---