[Zope] creation-ism issue
Dennis Allison
allison@sumeru.stanford.EDU
Sat, 19 Jul 2003 13:52:27 -0700 (PDT)
the usual incantation for creating an instance of a product is
folderishobject.manage_addProduct['product name'].manageaddXXXXX( ...)
I want to create programmatic instances of the ZUBB product which has
a meta_type of 'ZUBB Folder' confirmed by looking at the code.
The product seems to be properly installed, appears in the dropdown menu,
and creates instances through the ZMI.
But, the following script fails:
request = container.REQUEST
RESPONSE = request.RESPONSE
# add in an instance of the ZUBB product
# we work here
obj = container.restrictedTraverse('/agilediscussions')
print obj
print d_id, d_title
p = obj.manage_addProduct
print p
p = obj.manage_addProduct['ZUBB Folder']
print p
#p = p.mange_addZUBBFolder
#print p
#p(id=d_id, title=d_title)
return printed
with
Traceback (innermost last):
Module ZPublisher.Publish, line 98, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 39, in call_object
Module Shared.DC.Scripts.Bindings, line 252, in __call__
Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 314, in _exec
Module Script (Python), line 10, in createDiscussion
- <PythonScript at /agilediscussions/createDiscussion>
- Line 10
Module AccessControl.ZopeGuards, line 90, in guarded_getitem
Module App.FactoryDispatcher, line 26, in __getitem__
Module App.FactoryDispatcher, line 29, in __bobo_traverse__
Module App.Product, line 66, in _product
AttributeError: ZUBB Folder
What's can be the problem?
-d