[Zope] Calling ZClass constructors programmatically...
sean.upton@uniontrib.com
sean.upton@uniontrib.com
Fri, 20 Apr 2001 14:51:33 -0700
For some reason, it doesn't work (at least for my ZClass, which subclasses
ZCatalog:CatalogAware, and OFS:Folder), with code like:
container.manage_addProduct['Classifieds'].AdFolder_add(...)
I can't seem to publish 'Classifieds' - I get an AttributeError in
Product.py for 'Classifeds'.
Classifieds is a product created (only) within the ODB and contains a few
ZClasses. The thing that seems strange is that this technique works fine
for OFS:Folder:
container.manage_addProduct['OFSP'].manage_addFolder(...)
I feel fairly confident that if the
container.manage_addProduct['Classifieds'] namespace could be published
(shouldn't it be able to be seen?), that I would have no problem calling its
constructor this way.
I may end up swithching my project to the product API instead of using
ZClasses just to avoid all this confusion, though; I've just already spent a
bunch of time setting up
Sean
-----Original Message-----
From: Dieter Maurer [mailto:dieter@handshake.de]
Sent: Friday, April 20, 2001 11:40 AM
To: sean.upton@uniontrib.com
Cc: zope@zope.org
Subject: Re: [Zope] Calling ZClass constructors programmatically...
sean.upton@uniontrib.com writes:
> I have been trying a bunch of different things to instantiate a ZClass
> instance...
The documentation (Zope help -> API-Reference -> ObjectManager)
speaks of a standard way to instantiate anything:
<container>.manage_addProduct[<product_name>].<constructor>(....)
Have you tried it?
Dieter
_______________________________________________
Zope maillist - Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev )