[Zope] Namespace Confusion

Richard Wackerbarth rkw@dataplex.net
Wed, 31 Mar 1999 10:02:47 -0600 (CST)


I think that you missed my point.

"I" can write python just fine. However, every time something changes, new
python functions must be written. It is desirable to allow 
"DTML programmers" to do simple things which they can accomplish with simple
local variables.

What I think I should do is create a function, "LOCAL", similar to REQUEST
that stores temporary variables. Unlike REQUEST, LOCAL would be bound to
the namespace multiple times, each with a different context stack.

<!--#with "_.namespace(LOCAL=LOCAL.create('basketTotal','taxable')"-->
  <!--#call "LOCAL.set('basketTotal', 0)"-->
  <!--#in "['pear', 'peach', 'boot']"-->
    <!--#call "LOCAL.set('basketTotal',
                             LOCAL.get('basketTotal')
                             + priceOf(_['sequence-item']))"-->
  <!--#/in-->
The total basket will cost <!--#var "LOCAL.get('basketTotal')"-->  
<!--#/with-->

Or perhaps we can trick the namespace into showing basketTotal without
the LOCAL.get reference. 

 On Wed, 31 Mar 1999, Shaw, Howard wrote:

> Given your needs, I suspect a simple External Method would serve
> better...

> > What about the local variable?
> > Any ideas?