[Zope-PTK] Tools

Shane Hathaway shane@digicool.com
Fri, 12 Jan 2001 10:04:18 -0500


Lucas Hofman wrote:
> 
> Shane Hathaway wrote:
> >...  Or you can write a product that subclasses portal tools or
> > even ignores the standard base classes while implementing all the
> > required methods.
> >
> Do you have an example on how to do this? I find it difficult to see the
> whole picture.

I see what you're saying now.  You'd simply create another product with
some of the following code:

from Products.PTKBase.CatalogTool import CatalogTool
from Products.PTKBase.PortalObject import PortalObject

class HofmanCatalogTool(CatalogTool):

  def __init__(self):
    CatalogTool.__init__(self)
    # Add my own indices


class HofmanPortal(PortalObject):
  # Add code here which instantiates a HofmanCatalogTool
  # instead of a CatalogTool.


BTW I can see now that the portal instance generator needs to be
parameterized so that it's easy to cause it to create instances of
alternate tools.

Shane