[Zope] ZCatalog + Subclassing Woes

Stephen Pitts smpitts@midsouth.rr.com
Mon, 17 Jan 2000 19:16:27 -0600


I'm implementing search functionality on my site using ZCatalog. Right
now, the searching and indexing work fine, and I'm trying to make some
custom Z-Classes CatalogAware. 

All of my Z-Classes inherit from a Z-Class called CentralBase, which
contains a DTML method called "edit", which is used as the "action" for
all of their  management edit forms:

<dtml-call "propertysheets.Basic.manage_editProperties(REQUEST)">
<dtml-call "RESPONSE.redirect('editForm')">

To instantly make all of my Z-Classes CatalogAware, I figured that I
could just:
* recreate CentralBase so that it inherits from CatalogAware
  (is there a way to modify what Z-Classes a Z-Class subclasses from
  without recreating it? this is the biggest complaintm that I have with
  Z-Classes)
* modify edit and add "<dtml-call reindex_object>" below the first line
* change the add method (called by all of the *addForm methods) to also
  call "reindex_object"

Unfortunately, it wasn't that easy. When I recreated the CentralBase
class, it screwed up all of my other Z-Classes. The edit method
isn't getting acquired correctly.

Cannot locate object at:
http://localhost:8080/News/SiteUpdates/Welcome/edit 

Traceback (innermost last):
  File /home/smpitts/Zope-2.1.1-src/lib/python/ZPublisher/Publish.py,
line 214, in publish_module
  File /home/smpitts/Zope-2.1.1-src/lib/python/ZPublisher/Publish.py,
line 179, in publish
  File /home/smpitts/Zope-2.1.1-src/lib/python/Zope/__init__.py, line
202, in zpublisher_exception_hook
    (Object: ElementWithAttributes)
  File /home/smpitts/Zope-2.1.1-src/lib/python/ZPublisher/Publish.py,
line 151, in publish
  File
/home/smpitts/Zope-2.1.1-src/lib/python/ZPublisher/BaseRequest.py, line
334, in traverse
  File
/home/smpitts/Zope-2.1.1-src/lib/python/ZPublisher/HTTPResponse.py, line
521, in debugError
NotFound: (see above)

Does anyone have any suggestions?
-- 
Stephen Pitts
smpitts@midsouth.rr.com
webmaster - http://www.mschess.org