Re: toOne relationship returns base class instead of subcl

Sebastien Bigaret <[email protected]> 23 Jul 2004 21:00:27 +0200
Newsgroups gmane.comp.python.modeling
Message-ID <[email protected]>
John Lenton <[email protected]> wrote:
[...]
> actually, what's biting me is this (I'm translating from a different
> model into this one that is similar to the example, for clarity and
> brevity; I hope I don't muss ep):
> 
>     >>> [i.getPerson().getId() for i in ec.fetch('Address')]
>     [4, 5]
>     >>> ec.fetch('Address', 'person.id == 4')
>     []
> 
> in trying to simplify this last time I got the behaviour above, which
> I misinterpreted as the same thing.

Quickly replying here: this is absolutely not normal, and it would help
a lot if you could provide a sample model, code and data (sal dump is
ok).

Or maybe you were trying something like this? ->

>>> [i.getPerson().getId() for i in ec.fetch('Address')]
[4, 5]
>>> ec.fetch('Person', id == 4')
[]

instead of:
>>> ec.fetch('Person', id == 4', isDeep=1) # fetch the whole inheritce tree
[<PhysicalPerson instance at 0x...>]


-- Sébastien.



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_idG21&alloc_id040&op=click