Re: [SQLObject] More bugs with inheritance and transactions. Patch attached
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2005-08-10 15:08:42
|
On Wed, Aug 10, 2005 at 11:18:08AM -0300, Evandro Vale Miquelito wrote: > You should take a look at your database after running the script. > There is a new smaller script in the end of this mail. After running > that using SQLObject trunk(revision 897) I got this: > > evandro=# select * from data_table; > id | child_name > ----+----------------- > 1 | > 2 | DatatableWithII > 3 | Entity > 4 | Organization > (4 rows) > > evandro=# select * from classified_datatable; > id | child_name > ----+------------ > 2 | > 3 | > 4 | > (3 rows) > > evandro=# select * from datatable_with_i_i; > id | child_name > ----+------------ > 2 | > 3 | > 4 | > (3 rows) > > evandro=# select * from entity; > id | child_name > ----+------------ > 3 | > 4 | > (2 rows) > > evandro=# select * from person; > id | child_name > ----+------------ > (0 rows) > > evandro=# select * from organization; > id | child_name > ----+------------ > 4 | > (1 row) > > How can we expect inheritance works in this case ? That's absolutely normal. childName column is None (child_name IS NULL) for children rows; childName is only set in the topmost parent row. > Traceback after running the script follows: > > File "./small_test.py", line 50, in ? > print '%s, count: %s, list: %s' % (table.__name__, > File "./small_test.py", line 45, in get_class_names > for item in table.select(): > File "/home/evandro/devel/sqlobject/inheritance/iteration.py", line > 57, in next > childResults=childResults, connection=self.dbconn) > File "/home/evandro/devel/sqlobject/inheritance/__init__.py", line > 81, in get > return val._childClasses[childName].get(id, connection=connection, > selectResults=childResults) > KeyError: 'DatatableWithII' Ouch! :( I see. Something strange goes here. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |