[Zope] How do I use variable variables in pythonscript?

Jason.Jones@awl.com Jason.Jones@awl.com
23 Feb 2001 16:49:13 -0500


I would like to do something like the following:

<dtml-var "_[getform('do')]">

where getform('do') returns the name of the method that is then called, but I want to do it from a python script, that is, given a variable or a function, I would like to evaluate what it stands for, for instance:

for action in things_to_do:
    context.action()

where things_to_do is a list of names for method calls that I want to execute in the python script's context.

Is there a way to do this? What about something like the python script equivalent of the dtml:

<dtml-var "_[getform('do')+'_view']">

Thanks,

Jason