Hi all, Is it possible to programatically add a ZClass based product? I've done some testing with a product TestProduct, ZClass TestClass, constructor TestClass_add. The TestProduct is a basic product as generated by Zope, I don't have modified any object/method/prop sheet. When I run context.manage_addProduct['TestProduct'].TestClass_add() I get "Name Error, global name 'TestClass' is not defined". The error is produced by the line: <dtml-with "TestClass.createInObjectManager(REQUEST['id'], REQUEST)"> TIA Regards -- //// (@ @) ---------------------------oOO----(_)----OOo------------------------ Los pecados de los tres mundos desapareceran conmigo. Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain) --------------------------------------------------------------------
Alexis Roda writes:
Is it possible to programatically add a ZClass based product? Everything, you can do via ZMI you can do programmatically!
I've done some testing with a product TestProduct, ZClass TestClass, constructor TestClass_add. The TestProduct is a basic product as generated by Zope, I don't have modified any object/method/prop sheet.
When I run
context.manage_addProduct['TestProduct'].TestClass_add() Almost surely, "TestClass_add" is a DTML object.
When you call such objects you must pass context information. Please read the "Calling DTML objects" section in <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html> Dieter
participants (2)
-
Alexis Roda -
Dieter Maurer