Chris -- Well, running 2.5.0 on Madrake 8 something, I can tell you that it can work. So let's see what's going wrong. Did you rename your ZClass after building it? Can you post the contents of the add method? (Which, if Zope created it for you, will be called ZooExhibits_add, and will be located in the /Control_Panel/Products/Exhibits) ZClasses aren't (IMHO) quite as evil as some may tell you -- they have their place for quickly sketching out prototypes or building a simple data object that will be easier for a client/coworker to modify. If you don't have CVS running on your server, getting the versioning and history of your objects is also plus for ZClasses that Python Products wouldn't give. But Python Products are certainly preferable in many cases. Don't worry, though--there are lots of snags to consider once you start learning those, too. ;-) BTW, while the Zope Book is fine, it's gotten a bit out of date. Keep your paper copy to share with the grandkids, and use the online copy (which is much more updated) for learning, if you can. You can download it as a PDF. - J. -- Joel BURTON | joel@joelburton | www.joelburton.com | aim:wjoelburton Information Technology & Knowledge Management Consultant
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Chris Hall Sent: Saturday, July 27, 2002 11:43 AM To: zope@zope.org Subject: [Zope] Stupid ZClass question
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.p y, 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.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )