Once again I forgot to cc the list. Howard C. Shaw III Programmer/SysAdmin St. Thomas High School
---------- From: Shaw, Howard Sent: Tuesday, March 30, 1999 1:38 PM To: 'rkw@dataplex.net' Subject: RE: [Zope] Namespace Confusion
<!--#with _.namespace(this='that', theother='this')--> <!--#var this--> <!--#with _.namespace(a=['this','that','theotherthing'])--> <!--#in a--> <!--#var sequence-item--> <!--#/in--> <!--#/with--> <!--#/with-->
Howard C. Shaw III Programmer/SysAdmin St. Thomas High School
---------- From: Richard Wackerbarth[SMTP:rkw@dataplex.net] Reply To: rkw@dataplex.net Sent: Tuesday, March 30, 1999 1:19 PM To: zope@zope.org Subject: [Zope] Namespace Confusion
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?
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(For developer-specific issues, use the companion list, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )