Re: [SQLObject] InheritableSQLObject.addColumn fix
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Johan D. <jd...@as...> - 2006-10-19 18:58:26
|
Johan Dahlin wrote: > Oleg Broytmann wrote: >> On Wed, Oct 18, 2006 at 05:38:53PM -0300, Johan Dahlin wrote: >>> Any hints on how to solve this? >> I need to look into it. You know, the code is tricky... > > Okay, I found out what needed to be done. > > selectBy does not use the .q magic so we need to build up the query > manually. It turned out to be not so easy: > > SQLObject.selectBy uses DBAPI._SO_columnClause which cannot handle > inheritence, it was not designed with that in mind. > I had to copy over parts of _SO_columnClause into InheritedSQLObject and > build up a query which does a join on the parent classes. > > Tested using postgres and sqlite. I found a couple of problems when using more than two layers of inheritance, attaching an updated patch. Johan |