I think this is a related problem in that some of these properties are storing Test1 or Test2 as class_ when they need to be storing Test. Let me know what you think the problem is.
-Michael
On 3/26/06, Michael Carter <[EMAIL PROTECTED]> wrote:
Great,
I'll check out the latest revision. There was another issue that I ran into a couple hours ago. That is, if you turn database echo on for the test2 example you can see that every time you make a call like Test.get(1) or Test.get(2) the object is reloaded from the database. I believe that this is because identity_key is called on the Test classes mapper so you get something like (<class 'Test'>, (2,)) as the identity_key, but then when a Test2 or Test1 does a lookup it uses a key like (<class 'Test2'>, (2,)). A very quick hack I did was to change mapper.py so the identity_key function looked like this:
if hasattr(self.class_, '_base'):
return objectstore.get_id_key(tuple(primary_key), self.class_._base)
return objectstore.get_id_key(tuple(primary_key), self.class_)
Then I added _base = Test to both the Test1 and Test2 class. I know this is a very fragile and far less than ideal fix -- I was just trying to isolate the problem. I'm not sure where that information could or should actually be stored.
Thanks again for extending the code to make these examples possible.
-Michael