[Zope] Namespace Confusion
Richard Wackerbarth
rkw@dataplex.net
Tue, 30 Mar 1999 13:19:24 -0600 (CST)
I'm trying to convert shell scripts into DTML methods.
Please excuse the pseudo code. I'm using it to represent the problems
that I am addressing.
set basket_total=0
set taxable_total=0
foreach item( 'apple', 'peach', 'soap', 'pear', 'plum', 'magazine' )
if (! isfood($item))
@ taxable_total = $taxable_total + price_of($item)
endif
@ basket_total = $basket_total + price_of($item)
endfor
print "Of the $basket_total total, $taxable_total is taxable"
1) Can I generate an explicit list rather than getting it with
as the result of either a database query or enumeration of an object?
2) How do I generate "local" variables.
I know that I could use the REQUEST variable as a global property store.
However, because of nesting, global (REQUEST) variables are not desirable.
I'd like to say something like the following:
<!--#WITH "LOCAL_NAMESPACE (basket_total=0, taxable_total=0)"-->
<!--#FOR "['apple', 'peach', 'soap', 'pear', 'plum', 'magazine']"-->
...
<!--#SET basket_total=basket_total+price ...>
<!--#/FOR-->
...
<!--#var basket_total-->
...
<!--#/WITH-->
Does Zope's DTML have constructs to address either of these?