[Zope-CMF] Porting of normal zope product to cmf

Gitte Wange gitte@mmmanager.org
Mon, 17 Sep 2001 11:37:55 +0200


Hello,

I am trying to port an old Zope Product (a Shop product) to CMF.
In the old product there is a function that creates an order and it would be 
useful to also have this function in the new product :-)

To create the order object these lines of code are used (in my cmf product 
taken from the original product) :
ob = ShopOrder(id)
self._setObject(id, ob)
ob = getattr(self, id)
ob._initialize(credit_details, order_details, personal_details)
order = getattr(self, id)

But I get an error in line 2 - the self._setObject() call
The error is 
Error Type: AttributeError
Error Value: _setObject

and the last lines of the traceback is:
File 
/usr/local/Zope-2.4.0-linux2-x86/lib/python/Products/MMMShop/ShopManager.py, 
line 141, in createOrder
    (Object: DynamicType)
AttributeError: (see above)

I guess it's because the old object inhereted ObjectManager and mine doesn't 
... but doesn't CMF has it's own ObjectManager module ???

My question is then:
Should I call something else than _.setObject and if true: What should I call 
then in order to create the order object and get hold of it again ?

TIA,
Gitte Wange