[SQLObject] Superclass instances and multiple inheritence.
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Peter G. <pet...@st...> - 2004-06-22 17:34:54
|
Hello. I had a layout similar to class Actor(SQLObject): actorType = IntCol() class Store(Actor): name = StringCol(length = 64) When I insert new rows using Store.new(actorType = 1, name = "Test") it doesn't actualy insert a row in the actor table and the actorType column is also found in the store table. Even though this might seem like a smart optimization to make, it's not since I'm trying to implement a test slice from a larger model. Also, I sometimes need to fetch an Actor object to find out what type of actor I should continue fetching, but since there are no rows in the actor table I get an error telling that the object was not found. Further more, my model supports multiple inheritence of this nature: class Store(Actor, Organisation): .... It seems the second superclass is ignored completely, is this not support in SQLObject? As a final question I'd like to ask how where to put the transaction object when you are creating new rows. The transaction object can be passed as the second argument when getting objects, but not when creating new. Best regards, Peter Gebauer |