Re: is this a bug in modeling?

John Lenton <[email protected]> Wed, 25 Aug 2004 00:30:59 -0300
Newsgroups gmane.comp.python.modeling
Message-ID <[email protected]>
sorry, guys, please ignore. Next time I'll actually read the mail I've
brain-flagged for homework before working on it.

Again, sorry for the wasted time. I'll try to address the actual issue
I was trying to answer shortly.

On Mon, 23 Aug 2004 10:50:27 -0300, John Lenton <[email protected]> wrote:
> Hi all.
> 
> I've been owing you this for a while now.
> 
> The attached model, with Modeling 0.9-pre16 + sortBy/limit patch, and
> 0.9-pre17.1 + sortBy/limit + quoted entities patch, produces the same
> (bad?) behaviour. I can test it with a plain 0.9-pre17.1 if you think
> it's needed.
> 
> The behaviour is this: when an attribute is requested on a fault that
> stands in for an object that is a subclass of the target of the
> relation, and that attribute isn't present in the base class, an
> exception is raised. Thus:
> 
> >>> from Modeling.EditingContext import EditingContext
> >>> ec=EditingContext()
> >>> import Store
> >>> p=ec.fetch('Address')[0].getPerson()
> >>> p.isFault()
> True
> >>> p.getTag()
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> AttributeError: Person instance has no attribute 'getTag'
> >>> p.getId()
> 1
> >>> p.isFault()
> False
> >>> p.getTag()
> 'foo'
> >>>
> 
> 
> --
> John Lenton ([email protected]) -- Random fortune:
> The greatest of faults is to be conscious of none.
> 
> 
> 


-- 
John Lenton ([email protected]) -- Random fortune:
bash: fortune: command not found


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285