I'm following the instructions in "Adding ZClass Instances 
Programmatically" (http://www.zope.org/Members/tazzzzz/addZClasses), but 
Zope always returns an error.

Using the code from a DTMLMethod in another ZClass in the same product:

<dtml-with "manage_addProduct['MyProduct']">
<dtml-call "MyZClass_add(_.None, NoRedir=1)">

I get the error:

File /usr/local/Zope/lib/python/DocumentTemplate/DT_Util.py, line 339, 
in eval (Object: MyZClass.createInObjectManager(REQUEST['id'], REQUEST)) 
(Info: REQUEST) File , line 0, in ? NameError: MyZClass

So this is clearly having a problem finding MyZClass from the 
MyZClass_add method.

I then noticed that, according to the HowTo, if you are instantiating a 
ZClass from within another ZClass, you only need the code:

<dtml-call "MyZClass_add(_.None, NoRedir=1)">

However, this gives the error:

File /usr/local/Zope/lib/python/DocumentTemplate/DT_Util.py, line 339, 
in eval (Object: MyZClass_add(_.None, NoRedir=1)) (Info: _) File , line 
0, in ? NameError: MyZClass_add

Any suggestions?


Mark James Adams

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to