You should get both objects with isDeep=1, right...
but before that, you need to 'ec.insert(c)' as well ;)
-- Sébastien.
Lorenzo Gil Sanchez wrote:
> 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
>
|