Hello 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 ... ---------------------------------------------------------------------------- ---- my paintings : http:\\peinturesurlenet.free.fr my music : http:\\hurpasard.free.fr --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.593 / Virus Database: 376 - Release Date: 20/02/2004 _____________________________________________________________________ Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France
<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
gustav wrote at 2004-2-21 10:48 +0100:
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.
"exec" is one of the most dangerous commands. You understand that it is not available in "TTW" code. You might be able to put your variables in a dictionary (using "update" (in DTML) to extend the dictionary). -- Dieter
participants (3)
-
Dieter Maurer -
gustav -
Small Business Services