[Zope] adding zclass instance dynamically

Oliver Frommel oliver@aec.at
Mon, 19 Feb 2001 17:48:45 +0100 (CET)


Hello,

how can I add a ZClass depending on a form value? I have a form variable 
called "type" which contains the type of ZClass I want to add:

the "static" way is (working):
<dtml-with "manage_addProduct['MyObjects']">
  <dtml-with "article1.createInObjectManager(id, REQUEST)">
   <dtml-call "propertysheets.Basic.manage_editProperties(REQUEST)">
  </dtml-with>
</dtml-with>

now the form variable "type" either contains the string "article1" or 
"article2".

but calling 
<dtml-with "_[type].createInObjectManager(id, REQUEST)">
doesn't work.

what's the right way to do this?

thanks
--Oliver