Thanks! I think I've found the discussion you're talking about: http://groups.google.com/group/django-developers/browse_thread/thread/7d40ad373ebfa912/a20fabc661b7035d
So seems that this idea was in fact rejected because of the O(# of nodes in the inheritance tree) joins needed to get all the fields from subclass tables. But the idea of letting this as an optional way to retrieve data (so not the default way, but by using something like QuerySet.select_subclasses() as suggested on my previous email) could be a solution to this problem or not? Moreover I've dug a bit on how Hibernate handles inheritance and indeed it always make outer joins to subclasses (it has to since it doesn't use a discriminator column and returns, by default, instances of subclasses when querying for a base class). Anyway, what do you mean by "end-user add-on to models"? Where can I find info to make such an add-on? Or are you just talking about editing the django source code on my installation? Thanks again ;) Andrea On Aug 23, 10:25 am, Russell Keith-Magee <freakboy3...@gmail.com> wrote: > On Sun, Aug 23, 2009 at 9:18 AM, Andrea Zilio<m.ep...@gmail.com> wrote: > > > Hi all, > > > Here's what I'm talking about: > > You have 3 models: Place, Restaurant and Cinema where Restaurant and > > Cinema both inherits from Place. > > So in the database you have some simple places, some places which > > really are Cinemas and some places which really are Restaurants. > > > Well, I think that this should be possible: > >>>> Place.objects.all() > > [<Place>, <Cinema>, <Restaurant>, <Place>] > > (Current implementation only returns Places objects) > ... > > Maybe this has been previously discussed but I couldn't find any > > ticket or any discussion about it. > > So take this as a proposal if it wasn't already discussed or as a > > request to have some info about the previous discussion. > > This has been discussed, at length, and rejected. If you search the > django-dev archives, the discussion happened around the time that > model inheritance was being added to the ORM. For the most part, > you're looking for a series of discussions between myself and Malcolm. > Using "CORBA" as a keyword in your search will help (and if you know > anything about CORBA, will also explain why the idea was ultimately > rejected). > > The techniques to achieve this sort of thing are well known and well > established, but they do come at a cost. We opted not to wear that > cost by default in inherited models. If you want this capability, it > (or something functionally equivalent) can be added as an end-user > add-on to models. > > Yours, > Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---