Sorry, it was my mistake about:
> content_type = ContentType.objects.get_by_id(p.contenttype_id)
Try this:
> content_type = ContentType.objects.get_for_id(p.contenttype_id)

About overriding save() method see
http://docs.djangoproject.com/en/dev/topics/db/models/#overriding-predefined-model-methods

Save method in your Page model

def save(self, force_insert=False, force_update=False):
    if not self.content_type:
         self.content_type =
ContentType.objects.get_for_model(self.__class__)
    super(Page, self).save(force_insert, force_update)
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to