[Zope] Adding another base class to an existing ZClass

Chris McDonough chrism@digicool.com
Sun, 09 Jan 2000 23:29:36 -0500


BTW, the preferred workaround for this (for now) is to create an empty
Python base class someplace before you develop your ZClass and inherit
from it when you create the ZClass.  That way, if you need to inherit
from a different class later, you can wedge it into the empty Python
base class.  An example of a Python module with an empty base class:

class MyZClassBase:
    pass

An example of such a module when the base class has added inheritance:

import OFS.ObjectManager
class MyZClassBase(OFS.ObjectManager):
    pass

You can import this module and the class into Zope by creating a Zope
Product that includes a call to registerBaseClass in its __init__.py for
the class under which you'd like to subclass your ZClass.  See Amos'
Product API Tutorial and gtk's Boring product and related HOWTO for
examples.

Chris McDonough wrote:
> 
> AFAIK, there is no approved way to add a base class to an existing
> ZClass.  I've heard from other people at DC that it is possible, but
> it's a "hold on to your butts" experience.  That said, I have no idea
> whether Gregor's method will work or not.


-- 
Chris McDonough
Digital Creations, Inc.
Zope - http://www.zope.org