On Sun, 2008-06-08 at 22:24 -0700, Russell Keith-Magee wrote:
> 
> 
> On Jun 9, 12:53 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]>
> wrote:
> > Hi gang,
> >
> > I've been hunting down some bugs with serialization of multi-table
> > inheritance, and I need a sanity check on something that I want to
> > check in.
> 
> Aargh. Ignore this message - problem exists between keyboard and
> chair. I was reading some debug data from mid-model creation rather
> than looking at the final output state of the model. The first
> OneToOneField in an inherited model is set as the primary key; it just
> happens a little later in the metamodel creation process.

Yes, that's correct. It's a little messy flow-wise, but alternatives end
up pretty jumbled to. OneToOneField shouldn't be a compulsory primary
key, since (a) that's not a semantic requirement and (b) it rules out
multi-parents. However, there's no need to add an extra field if we do
have at least one-to-one, so the __new__ method does all the setup
initially and then, when trolling to see if a primary key is needed,
uses any existing parent links as candidates for promotion (it's
transparent for the auto-created links, so shouldn't harm anybody).

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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to