On Wed, 2006-05-17 at 20:12 +0000, [EMAIL PROTECTED] wrote:

> class Blog(BaseContent):
> 
>     def get_absolute_url(self):
>         return "/diario/%s/" % self.userId
> 
>     class Admin:
>         pass
> 
>     class Meta:
>         verbose_name    = 'diario'
>         db_table        = 'jhonWebBlog'
> 
[...]
> 
> So, I remove the subclassing, copy the fields from BaseContent to Blog,
> then recreate the database and try.
> 
> Work fine...

Model inheritance does not work in the development version. Because of
some changes in the magic-removal branch things that did work in 0.91
have stopped working. Don't use model inheritance at the moment.

This does not mean you have to repeat all you code, though. You can fake
inheritance the way you do in languages without OO. Back when dinosaurs
roamed the earth and everybody programmed in C, if you wanted to have
one struct "inherit" from another, the child would just contain a
pointer to the parent. Similarly here,

        class Blog(models.Model):
           parent_model = models.ForeignKey(BaseContent, unique = True)
           ...
        
Now you have to access the parent objects via blog_obj.parent_model.foo,
unfortunately, but that is usually survivable.

Work is ongoing to get model inheritance working the development
version. I started writing code last weekend to do this, but it's at
least a couple of weeks away from even being submitted to the
developer's list for review, so it's not going to appear in the trunk
anytime soon. For now, just say "no". And use the foreign key trick if
you really need to.

Regards,
Malcolm


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

Reply via email to