Dieter Maurer wrote:
> 
> Richard Jones writes:
>  > As the subject says, REQUEST.set('n', n+1) is broken on zope.org. The
>  > following DTML will raise an AttributeError on __add__:
>  >
>  > <dtml-call REQUEST.set('n', 1)>
>  > <dtml-call REQUEST.set('n', n+1)>
> There may be a simple explanation
> (someone else already pointed out, that you need to use "...";
> I expect, you did as otherwise, you would get a "KeyError"):

    Yeah, sorry my example code was wrong.


>   There may be an object named "n" somewhere in the
>   acquisition context. An object that does not define
>   an "__add__" method.
> 
> As you probably know (or can reread in the documentation),
> "REQUEST" has quite a low priority for lookups
> (in fact, it is at the bottom of the acquisition context).
> It is therefore easy to have a REQUEST definition overridden.
> Use "REQUEST['n']+1" instead of "n+1".

  This fixed the problem, thanks. I'm only just getting back into Zope,
and I suppose acquisition hadda bite me at least once :)


     Richard

-- 
Richard Jones
[EMAIL PROTECTED]
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)

_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to