[Modeling-users] (more) problems with inheritance
Status: Abandoned
Brought to you by:
sbigaret
From: Lorenzo G. S. <lg...@si...> - 2004-08-17 18:42:16
|
Hi again :-) Using the dynamic module (from CVS) I was able to create the Python classes of my model, which uses inheritance: My model has two entities: Person and Customer, which inherits from Person. My problem now is related to fetches. I have two instances on my EditingContext: a person and a customer: ec = EditingContext() p = Person() p.setName('Erny') ec.insert(p) print p c = Customer() c.setName('Lorenzo') c.setPhone('93923924') print c Now, how do I get all the person in my editing context? query = ec.fetch('Person', isDeep=1) print len(query) 1 As you can see I'm getting one object when I should been getting two since the Customer is-a Person Am I doing something wrong or I just hit a bug? I'll attach the whole code so everybody can test it. Regards Lorenzo |