On Sun, 2006-07-23 at 13:02 +0400, Ivan Sagalaev wrote:
> First of all: Malcolm, this looks damn cool and very well thought out! 
> Thank you!

Thanks.

> 
> Malcolm Tredinnick wrote:
> > ---------------------------
> > 2. "Pythonic" Inheritance
> > ----------------------------
> > ...
> > 
> > (in the above classes, Animal
> > would have a foreign key reference to the Thing table, similarly for
> > Toy).
> 
> Why foreign key? This means that data of one Thing object can be shared 
> between two different Animal objects. That seems strange, I'd rather 
> expected it to be one-to-one relation.

Good catch. :-)

It's a typo; the code is using a variation on OneToOneField there. I
have to hack around things a bit for multiple inheritance, since pure
Django OneToOneFields want to be primary keys and you can only have one
of those. But it is a one-to-one relation to each parent.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to