Re: [SQLObject] Inheritance management
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Philippe N. <ph...@re...> - 2005-04-28 11:21:28
|
Le 28/4/2005, "Oleg Broytmann" <ph...@ma...> a =E9crit: >On Thu, Apr 28, 2005 at 01:07:40PM +0200, Philippe Normand wrote: >> - i'd like to make A and B inherit from a class C. >> >> The fact is, since A et B used to exist "in their corner", i can have >> both some A and B objects with the same ID. From what i understood from >> the Inheritance documentation, when i will create a A instance, it's ID >> will also be inserted in C, something like: (someID, "A"). > > Exactly opposite. > > a =3D A() > b =3D B() > > The first insert goes to C: >(1, 'A') > Then this id returned to A (a.id =3D=3D 1) > > The next insert again goes to C: >(2, 'B') > Now b.id =3D=3D 2. > Oh ok ;-) But this doesn't change the problem. I don't want to change all existing ids in A and B, so do you see a simple way to avoid id clashes in C ? Philippe |