Hi

Normally you would call the recursive method  form a DTML Source. In this source you would write <dtml-let aa=0><dtml-var a></dtml-let>. This gives you a "global" variable. I used it and it works. I would also suggest to use external Python for recursion because DTML-recursion is VERY slow!

Regards
Oliver

-----Original Message-----
From: iap@y2fun.com [mailto:iap@y2fun.com]
Sent: Tuesday, October 30, 2001 9:33 AM
To: zope@zope.org
Subject: [Zope] Recursive Calling the same DTML Method is not validated?


Suppose we have a DTML Method named "A"
---------------------------------------------------------
<dtml-unless "REQUEST.has_key('aa')">
    <dtml-call "REQUEST.set('aa',0)">
</dtml-unless>

<dtml-call "REQUEST.set('aa',REQUEST['aa']+1)">
<dtml-var "REQUEST['aa']">

<dtml-if "REQUEST['aa']>10">
   <dtml-return "''"><dtml-comment>Stop here</dtml-comment>
<dtml-else>
   <dtml-var A><dtml-comment>Go deeper</dtml-comment>
</dtml-if>
---------------------------------------------------------
Excute it, then got the result:

Error Type: KeyError
Error Value: validate
---------------------------------------------------------
This is a sample method abstracted from my another more complex method
which works in the previous version of Zope.
I know that there are something changed in the SecurityManager.
But I have no idea how to make this sort of recursive method works again.
Any suggestion?
Thanks.
Iap, Singuan



_______________________________________________
Zope maillist  -  Zope@zope.org
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 )