[Zope] Stupid ZClass question

Chris Hall hall.cj@verizon.net
Sat, 27 Jul 2002 05:42:39 -1000


Running Zope 2.5 on Mandrake 7 something, Python 2.1.1.

I've spent literally most of the night trying to get this to work (the 
birds are outside are starting to sing), and most of *that* time was 
searching/browsing the Zope-related mailing lists, books, whatever I 
could get Google to suggest - I've seen a couple 'almosts', but I *know* 
I must be doing something wrong.

Anyway: I'm defined to Zope as a 'manager', 'admin', etc. I've created a 
product folder, let's call it 'Exhibits', and inside that I've created a 
ZClass, let's call it 'ZooExhibit'.  (Real names, BTW, following along 
with Zope Book - hardcopy, even).  I do everything 'by the book'. 
 Several times, over and over.

I can create DTML methods, Formulator forms, ZSQLMethods, etc., and play 
with them to my heart's content, get them to all work together nicely, 
but can't seem to get started with even the simplest ZClass.

I have a folder under the root folder, 'chris_play'.  I select add 
'ZooExhibit', get the add screen, supply an id 'Gorilla', and click 
'Add'.  Even if I try this in the product folder, or in a folder under 
the product folder (shouldn't the sub-folder's namespace stack include 
the parent folder's objects as well?).

*Everytime*, the next thing I see is:

*NameError*

Sorry, a site error occurred.

Traceback (innermost last):
  File /usr/local/src/Zope/Zope25/lib/python/ZPublisher/Publish.py, line 150, in publish_module
  File /usr/local/src/Zope/Zope25/lib/python/ZPublisher/Publish.py, line 114, in publish
  File /usr/local/src/Zope/Zope25/lib/python/Zope/__init__.py, line 158, in zpublisher_exception_hook
    (Object: ZooExhibit_factory)
  File /usr/local/src/Zope/Zope25/lib/python/ZPublisher/Publish.py, line 98, in publish
  File /usr/local/src/Zope/Zope25/lib/python/ZPublisher/mapply.py, line 88, in mapply
    (Object: ZooExhibit_add)
  File /usr/local/src/Zope/Zope25/lib/python/ZPublisher/Publish.py, line 39, in call_object
    (Object: ZooExhibit_add)
  File /usr/local/src/Zope/Zope25/lib/python/OFS/DTMLMethod.py, line 127, in __call__
    (Object: ZooExhibit_add)
  File /usr/local/src/Zope/Zope25/lib/python/DocumentTemplate/DT_String.py, line 473, in __call__
    (Object: ZooExhibit_add)
  File /usr/local/src/Zope/Zope25/lib/python/DocumentTemplate/DT_With.py, line 61, in render
    (Object: ZooExhibit.createInObjectManager(REQUEST['id'], REQUEST))
  File /usr/local/src/Zope/Zope25/lib/python/DocumentTemplate/DT_Util.py, line 159, in eval
    (Object: ZooExhibit.createInObjectManager(REQUEST['id'], REQUEST))
    (Info: REQUEST)
  File <string>, line 2, in f
NameError: global name 'ZooExhibit' is not defined

Makes writing a Python Product look more attractive, especially after 
reading some of posts comparing ZClasses to Python Products.

TIA,
Chris Hall
(More than slightly frustrated) Budding Zopista

-- 
One OS to rule them all, one OS to find them,
One OS to bring them all and in the database bind them,
In the Land of Redmond, where the Shadows lie.