----- cut here ----- DTML Method
<dtml-let myvars="{ 'somevar': 5 }"> <!-- Create My Own Namespace -->
<dtml-with myvars mapping> <!-- and Push onto the Search Stack -->
Before: <dtml-var somevar>
<dtml-call mypython>
After: <dtml-var somevar>
</dtml-with>
</dtml-let>
----- cut here ----- Script(Python) Method
## Script (Python) "mypython"
##bind container=container
##bind context=context
##bind namespace=_
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
_['myvars']['somevar'] = 7
When the DTML Method is invoked, this will print:
Before: 5
After: 7
When the end of the DTML-WITH is reached, the namespace will be popped/discarded, so it won't be permanent, as you wish to avoid.
Hope this helps,
Jeff Rush
Asad Habib wrote:
Hello. Does anyone know how to create a variable in a DTML method which may be updated by a Python script? I am currently using the set method of the REQUEST object to create a variable. However, creating a variable in this fashion renders it permanent. Any help would be appreciated. Thanks.
_______________________________________________
Zope-Dev maillist - [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )