I'm fairly new to Python & Zope and am hoping someone could lend a hand.... How would one go about instantiating a 'Product' via DTML? Such as, for example, a ZCatalog? I'm tried the following (arguments may not be exact here): <dtml-call "manage_addZCatalog('Catalog')"> <dtml-call "Control_Panel.Products.ZCatalog.manage_addZCatalog('Catalog')"> (hoping I can call the "static" method in the ZCatalog definition) <dtml-with "addProduct['ZCatalog']"> <dtml-call "manage_addZCatalog('Catalog')"> or (after adding appopriate Properties to REQUEST) <dtml-call "manage_addZCatalog(_.None, _)"> </dtml-with> Is it possible to access the manage_addZCatalog method directly (as is the case with internal classes, such as Image's manage_addImage)? How exactly is it that the 'internal' classes have their manage_add* methods in the Global Namespace? Or, are they actually part of the Zope tree (off root?), thus available via acquisition? Thanks.....
Terribly sorry... This was posted to the wrong list. ----- Original Message ----- From: Ray <zopelist@circle17.com> To: zope-dev <zope-dev@zope.org> Sent: Wednesday, April 26, 2000 2:48 PM Subject: [Zope-dev] Newbie Alert: creating Products with DTML
I'm fairly new to Python & Zope and am hoping someone could lend a hand....
How would one go about instantiating a 'Product' via DTML? Such as, for example, a ZCatalog? I'm tried the following (arguments may not be exact here):
<dtml-call "manage_addZCatalog('Catalog')">
<dtml-call "Control_Panel.Products.ZCatalog.manage_addZCatalog('Catalog')"> (hoping I can call the "static" method in the ZCatalog definition)
<dtml-with "addProduct['ZCatalog']"> <dtml-call "manage_addZCatalog('Catalog')"> or (after adding appopriate Properties to REQUEST) <dtml-call "manage_addZCatalog(_.None, _)"> </dtml-with>
Is it possible to access the manage_addZCatalog method directly (as is the case with internal classes, such as Image's manage_addImage)? How exactly is it that the 'internal' classes have their manage_add* methods in the Global Namespace? Or, are they actually part of the Zope tree (off root?), thus available via acquisition?
Thanks.....
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Hi, You might check out KM|Net News. In the current version, the KMArticleStore_add method creates a ZCatalog. ----- Original Message ----- From: "Ray" <zopelist@circle17.com> To: "zope-dev" <zope-dev@zope.org> Sent: Wednesday, April 26, 2000 4:48 PM Subject: [Zope-dev] Newbie Alert: creating Products with DTML
<dtml-with "addProduct['ZCatalog']"> <dtml-call "manage_addZCatalog('Catalog')"> or (after adding appopriate Properties to REQUEST) <dtml-call "manage_addZCatalog(_.None, _)"> </dtml-with>
Make that "manage_addProduct['ZCatalog']"
Is it possible to access the manage_addZCatalog method directly (as is the case with internal classes, such as Image's manage_addImage)? How exactly is it that the 'internal' classes have their manage_add* methods in the Global Namespace? Or, are they actually part of the Zope tree (off
root?),
thus available via acquisition?
Basically, that's correct. I believe those objects are in the lib/python/OFS directory. ZCatalog was written as a separate "Zope Product", so you need to use the product syntax to instantiate it. Kevin
participants (2)
-
Kevin Dangoor -
Ray