It does not work currently. Ticket #1656 at djangoproject refers to
this:

http://code.djangoproject.com/ticket/1656

This is apparently one of the projects being covered by the Google
Summer of Code.
Some discussion of it is at:

http://code.djangoproject.com/wiki/ModelInheritance

I myself need inheritance, and the 'join' method is unpleasant because
I use a lot of basically abstract-base-classes and this would be a big
performance hit.

I have found that you can basically mimic the 0.91 behaviour (until
they finish bringing in model-inheritance..at which time I expect this
backwards hack to break totally) by doing inheritance as you did it in
0.91 but you need to define the manager manually for your subclassed
objects.  This code seems to work:

class Foo(models.Model):
    name = models.CharField(maxlength = 80)

    def __str__(self):
        return "Foo %s" % self.name

    def commit(self):
        print "Doing commit on %s" % str(self)

    class Admin:
        pass

class Bar(Foo):
    sub_name = models.CharField(maxlength = 80)
    objects = models.Manager()

    def __str__(self):
        return "Bar %s/%s" % (self.name, self.sub_name)

    class Admin:
        pass


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