Re: [SQLObject] Inheritance strangeness
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: michelts <mic...@gm...> - 2005-06-03 15:22:43
|
For now I use the following syntax:
Employee.select(Person.q.name =3D=3D 'some name')
The column name is originally from Person...
regards,
On 6/3/05, Oleg Broytmann <ph...@ph...> wrote:
> On Fri, Jun 03, 2005 at 07:05:50PM +1000, ab...@ne... wrote:
> > class Employee(Person):
> > _connection =3D conn
> > _inheritable =3D False # comment this line to s=
olve bug OR
> > #position =3D StringCol(default=3D'Chief') # uncomment this line =
to solve bug
>=20
> I've found the cause of the problem. Inheritance machinery does not
> like classes that don't have attributes (beside obvious id). The
> machinery needs to propagate columns from an every parent class to all
> its children, but in a class with no attributes the code is not
> triggered!
> I'll look further if I can trigger the code somewhere else. Meanwhile
> you've found two ways to overcome the problem. Either add a fake column
> or a StringCol("childName") via setting _inheritable =3D True.
>=20
> > in my situation not all
> > my inherited classes define extra attributes (e.g. they instead have
> > different behaviour etc.)
>=20
> PS. I wonder how do they have different behavior without any
> attributes? Via properties, I suppose?
>=20
> Oleg.
> --
> Oleg Broytmann http://phd.pp.ru/ ph...@ph...
> Programmers don't die, they just GOSUB without RETURN.
>=20
>=20
> -------------------------------------------------------
> This SF.Net email is sponsored by Yahoo.
> Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
> Search APIs Find out how you can build Yahoo! directly into your own
> Applications - visit http://developer.yahoo.net/?fr=3Doffad-ysdn-ostg-q22=
005
> _______________________________________________
> sqlobject-discuss mailing list
> sql...@li...
> https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
>=20
--=20
Michel Thadeu Sabchuk
Curitiba - Brasil
|