[Zope-dev] ZPatterns: getItem returns None

Roch'e Compaan roche@ybm.co.za
Mon, 19 Mar 2001 18:47:06 +0200


> On Mon, 19 Mar 2001, Roch'e Compaan wrote:
> > In all simplicity I still can't get it to work but here's some more i=
nfo
> > from the console:
> >
> > Traceback (innermost last):
> >   File
> > C:\PROGRA~1\ZOPE230\lib\python\Products\ZPatterns\AttributeProviders.=
py,
> > line 335, in _AttributeFor
> >     (Object: GAPMixin)
> >   File C:\PROGRA~1\ZOPE230\lib\python\Products\ZPatterns\Expressions.=
py,
> > line 13
> > 6, in eval
> > KeyError: AllotmentArea_ID
>
> If I knew more about the internals of ZPatterns I bet this would tell m=
e
> exactly what's wrong, but I don't, so it doesn't.  Have you looked at
> the information screen that tells you which attributes are handled by
> which providers to make sure it is your skinscript that is providing th=
e
> attribute?  To my limited knowledge it looks like maybe the wrong
> attribute

A single line of SkinScript acts as the "Getter" for AllotmentArea_ID:
	WITH QUERY sqlGetAllotmentArea(AllotmentArea_ID=3Dself.id) COMPUTE
AllotmentArea_ID, AreaName, AreaCode

There are no persistent attribute or sheet providers - I deleted all of t=
hem
and the proxy role for the SkinScript is set to manager.  I fired up the
python debugger as well and it seems if and "instance" is retrieved but t=
he
attribute is not computed as specified by the SkinScript.

> provider is getting into the act.  Hopefully someone with more knowledg=
e
> than me will chime in <wry grin>.

We'll thanks for your pointers anyway.

Roch=E9