[Zope] Simple Example problem: ZooExhibit ZClass

Derek Simkowiak dereks@realloc.net
Mon, 25 Feb 2002 16:39:52 -0800 (PST)


	I am trying to create a simple ZClass as per Chapter 12 of _The
Zope Book_.  I can create the ZClass, but I cannot add one to my folders.

	When I go to the root folder and select "Zoo Exhibit" from the
"Select type to add..." list, it asks for the id.  (So my auto-generated
ZooExhibit_addForm DTML Method is working.)

	But when I click on the "Add" button, thus [theoretically]
invoking the auto-generated ZooExhibit_add DTML Method, I get the
following "Site Error" page displayed to me as simple text -- that is, the
HTML is not rendered by my browser, I actually see the raw HTML code in my
right-side browser frame:

---------------------------------------------------------
<TABLE BORDER="0" WIDTH="100%">
<TR VALIGN="TOP">

<TD WIDTH="10%" ALIGN="CENTER">
&nbsp;
</TD>

<TD WIDTH="90%">
<H2>Site Error</H2>
<P>An error was encountered while publishing this resource.
  </P>
<P><STRONG>NameError</STRONG></P>
Sorry, a site error occurred.<p>
<!--
Traceback (innermost last):
  File /usr/lib/python2.1/site-packages/ZPublisher/Publish.py, line 223, 
in publish_module
  File /usr/share/zope/lib/python/Products/Localizer/__init__.py, line 53, 
in new_publish
  File /usr/lib/python2.1/site-packages/ZPublisher/Publish.py, line 187, 
in publish
  File /usr/share/zope/lib/python/Zope/__init__.py, line 226, in 
zpublisher_exception_hook
    (Object: ZooExhibit_factory)
  File /usr/lib/python2.1/site-packages/ZPublisher/Publish.py, line 171, 
in publish
  File /usr/lib/python2.1/site-packages/ZPublisher/mapply.py, line 160, in 
mapply
    (Object: ZooExhibit_add)
  File /usr/lib/python2.1/site-packages/ZPublisher/Publish.py, line 112, 
in call_object
    (Object: ZooExhibit_add)
  File /usr/share/zope/lib/python/OFS/DTMLMethod.py, line 199, in __call__
    (Object: ZooExhibit_add)
  File /usr/lib/python2.1/site-packages/DocumentTemplate/DT_String.py, 
line 546, in __call__
    (Object: ZooExhibit_add)
  File /usr/lib/python2.1/site-packages/DocumentTemplate/DT_With.py, line 
133, in render
    (Object: ZooExhibit.createInObjectManager(REQUEST['id'], REQUEST))
  File /usr/lib/python2.1/site-packages/DocumentTemplate/DT_Util.py, line 
231, in eval
    (Object: ZooExhibit.createInObjectManager(REQUEST['id'], REQUEST))
    (Info: REQUEST)
  File &lt;string&gt;, line 2, in f
    (Object: guarded_getitem)
NameError: global name 'ZooExhibit' is not defined

-->
<HR NOSHADE>

<P>Troubleshooting Suggestions</P>

<UL>
<LI>The URL may be incorrect.</LI>
<LI>The parameters passed to this resource may be incorrect.</LI>
<LI>A resource that this resource relies on may be
      encountering an error.</LI>
</UL>

<P>For more detailed information about the error, please
  refer to the HTML source for this page.
  </P>

<P>If the error persists please contact the site maintainer.
  Thank you for your patience.
  </P>
</TD></TR>
</TABLE>

---------------------------------------------------------

	Notice the

NameError: global name 'ZooExhibit' is not defined

	I don't know what this means or why it's not working.  I believe I
have followed the instructions in the tutorial exactly.  It's not a
permissions thing because I have tried both (a) giving the Manager account
the ability to "Add Zoo Exhibit", and (b) changing the
"ZooExhibit_factory"  permission to be "Add Documents, Images, and Files",
with no change in behavior.

	I would be very grateful if somebody could advise me on how to
troubleshoot this problem.

	Here is my system info:

[dereks@dereks dereks]$ rpm -qa | grep -i zope
Zope-zserver-2.4.3-1
Zope-2.4.3-1

[dereks@dereks dereks]$ cat /etc/mandrake-release 
Mandrake Linux release 8.1 (Vitamin) for i586

[dereks@dereks dereks]$ rpm -q python python-devel
python-2.1.1-3mdk
python-devel-2.1.1-3mdk


Thank You,
Derek Simkowiak