[Zope-dev] Adding products dynamically
Kevin Dangoor
kid@kendermedia.com
Tue, 14 Dec 1999 11:02:08 -0500
----- Original Message -----
From: "Mats Myrberg" <mats@bigbig.to>
To: <zope-dev@zope.org>
Sent: Tuesday, December 14, 1999 2:23 AM
Subject: [Zope-dev] Adding products dynamically
> <dtml-with "manage_addFolder(formxx_id, formxx_title)">
> <dtml-call "manage_addBoring(formxx_id)">
> <dtml-call "RESPONSE.redirect(formxx_id)">
> </dtml-with>
>
> However, Zope has a hard time finding the manage_addBoring method. I can
> add a Boring product "manually" while in Zope management interface. What
do
> I have to do to add manage_addBoring to the global namespace (just like
> manage_addFolder etc).
I think for manage_addBoring to be global, you'd probably have to stick in
in lib/python somewhere (not in Products). However, you don't need to go to
that extreme. This is untested, but I think it would work:
<dtml-with "manage_addFolder(formxx_id, formxx_title)">
<dtml-with "manage_addProduct['Boring']">
<dtml-call "manage_addBoring(formxx_id)">
<dtml-call "RESPONSE.redirect(formxx_id)">
</dtml-with>
</dtml-with>
If you do a view source (a browser view source, not a DTML view source) on
the Zope management interface, you can see it doing things like this.
Kevin