Hello, I know this is a FAQ but I didn't manage to add a ZClass to a folder in DTML although I followed all steps in the How-To. My new ZClass needs only to have an 'id', so I just go with the default installation. Here is what I do: Create a product, name 'tip' In the product create a ZClass name 'kingkong' In folder /admin I have DTML Method 'addTip' which does <dtml-with "manage_addProduct['tip']"> <dtml-call "kingkong_add(_, REQUEST, NoRedir=1)"> </dtml-with> When I call addTip?id=123 I get an NameError. Traceback says Error Type: NameError Error Value: kingkong Traceback (innermost last): File /usr/local/Zope-2.2.5-linux2-x86/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/Zope-2.2.5-linux2-x86/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/Zope-2.2.5-linux2-x86/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/Zope-2.2.5-linux2-x86/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/Zope-2.2.5-linux2-x86/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: dtTipp) File /usr/local/Zope-2.2.5-linux2-x86/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: dtTipp) File /usr/local/Zope-2.2.5-linux2-x86/lib/python/OFS/DTMLMethod.py, line 172, in __call__ (Object: dtTipp) File /usr/local/Zope-2.2.5-linux2-x86/lib/python/DocumentTemplate/DT_String.py, line 528, in __call__ (Object: dtTipp) File /usr/local/Zope-2.2.5-linux2-x86/lib/python/DocumentTemplate/DT_With.py, line 146, in render (Object: _['Control_Panel'].Products.tip.kingkong) File /usr/local/Zope-2.2.5-linux2-x86/lib/python/DocumentTemplate/DT_Util.py, line 337, in eval (Object: kingkong_add(_, REQUEST, NoRedir=1)) (Info: REQUEST) File <string>, line 0, in ? File /usr/local/Zope-2.2.5-linux2-x86/lib/python/OFS/DTMLMethod.py, line 172, in __call__ (Object: kingkong_add) File /usr/local/Zope-2.2.5-linux2-x86/lib/python/DocumentTemplate/DT_String.py, line 528, in __call__ (Object: kingkong_add) File /usr/local/Zope-2.2.5-linux2-x86/lib/python/DocumentTemplate/DT_With.py, line 133, in render (Object: kingkong.createInObjectManager(REQUEST['id'], REQUEST)) File /usr/local/Zope-2.2.5-linux2-x86/lib/python/DocumentTemplate/DT_Util.py, line 337, in eval (Object: kingkong.createInObjectManager(REQUEST['id'], REQUEST)) (Info: REQUEST) File <string>, line 0, in ? NameError: (see above) I really don't understand why? Any ideas? Could you provide me with a working example? Viele Grüße Ulrich -- Searchengine Know How - Webpromotion - Optimization - Internal Search World Wide Web Publisher, Ulrich Wisser, Odensvag 13, S-14571 Norsborg http://www.publisher.de Tel: +46-8-53460905 Fax: +46-8-534 609 06
Ulrich Wisser wrote:
Hello,
I know this is a FAQ but I didn't manage to add a ZClass to a folder in DTML although I followed all steps in the How-To. My new ZClass needs only to have an 'id', so I just go with the default installation. Here is what I do:
Create a product, name 'tip' In the product create a ZClass name 'kingkong' In folder /admin I have DTML Method 'addTip' which does
<dtml-with "manage_addProduct['tip']"> <dtml-call "kingkong_add(_, REQUEST, NoRedir=1)"> </dtml-with>
When I call addTip?id=123
I get an NameError. Traceback says
Error Type: NameError Error Value: kingkong
[snip] I see references to method called dtTipp. Please submit the code for this method, I believe it may be the culprit. -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
participants (2)
-
Casey Duncan -
Ulrich Wisser