[Zope] calc sheet

Small Business Services toolkit at magma.ca
Sat Feb 21 09:00:37 EST 2004


<snip>
> I want to create something like a simple calc-sheet in zope :
> lines & rows coming from objects created by zclass
> input information and make some simple predefined calculation like sums
and
> multiplication
>
> To do that I wanted to assign DYNAMICALLY variables (via exec(statement)
but
> it seems that this is not possible with zope.
>
> How can I go on ...

A couple of ideas:

1) use an external method

2) create a dtml method programmatically (which allows you to create
variable names dynamically) and then execute the new dtml method:

eg.

<dtml-call "REQUEST.set('routine', 'tst2')">
<dtml-call "REQUEST.set('dtmlcode', '<dtml-var
standard_html_header><dtml-var REQUEST><dtml-var standard_html_footer>')">

<dtml-comment> create the new method </dtml-comment>
<dtml-call "manage_addDTMLMethod(routine, 'newtitle')">

<dtml-comment> now put some content into the new dtml method </dtml-comment>
<dtml-call "_.getitem(routine).manage_edit(dtmlcode, 'newtitle2')">

<dtml-comment> now execute the new method </dtml-comment>
<dtml-var "_[routine]">


HTH

Jonathan




More information about the Zope mailing list