Re: [Modeling-users] toOne relationship returns base class instead of subcl
Status: Abandoned
Brought to you by:
sbigaret
|
From: John L. <jl...@gm...> - 2004-08-25 03:53:09
|
On 29 Jul 2004 10:30:02 +0200, Sebastien Bigaret
<sbi...@us...> wrote:
>
> Again, could you be a little more explicit, or exhibit a short
> example? Sorry for getting back on this, but the only way I think this
> can happen is the one I already posted (see below); if it's not the
> case, this is a serious bug I definitely do not want to let escape.
sorry for the delay in answering, and the confusion when doing so. I
feel terribly embarrassed :(
HOWever, here goes.
With the attached model (which is ugly, and breaks some of your naming
conventions, but I just hacked out the attributes and renamed things
from the model being used by a team I'm helping to get up to speed),
using vainilla MDL 0.9-pre17.1 and NF 0.7:
>>> from Modeling.EditingContext import EditingContext
>>> import Store
>>> ec=EditingContext()
>>> ec.fetch('Address')[0]
<Address.Address object at 0x4071c74c>
>>> a = _
>>> p = ec.fetch('Person', isDeep=1)[0]
<Employee.Employee object at 0x4072d88c>
>>> p = _
>>> a.getPerson()
<Employee.Employee object at 0x4072d88c>
>>> a.getPerson().getId()
1
>>> a.isFault()
False
>>> p.getAddress()
<Modeling.FaultHandler.AccessArrayFaultHandler instance at 0x40733a4c>
>>> list(p.getAddress())
[<Address.Address object at 0x4071c74c>]
>>> ec.fetch('Address', 'Person.id == 1')
[]
>>> ec.fetch('Address', 'Person.id == 1', isDeep=1)
[]
--
John Lenton (jl...@gm...) -- Random fortune:
bash: fortune: command not found
|