[Zope-dev] Creating Python base class for ZClasses

Itamar Shtull-Trauring itamars@ibm.net
Sun, 21 Nov 1999 15:41:25 +0200


I want to create a Python base class that inherits from the ObjectManager
ZClass, since I want to have it automatically add the "Subobjects" tab in
the ZClass management screen.  Inheriting from
OFS.ObjectManager.ObjectManager does not do this - I need to inherit from
ZClasses.ObjectManager.ObjectManager.

Would the appropiate way to do this be:

class MyObjectManager(ZClasses.ObjectManager.ObjectManager):
    " .... "

class ZMyObjectManager:
    """Mix-in for Object Management
    """

    _zclass_=myObjectManager

    propertysheets=ZClasses.ObjectManager.ZObjectManagerPropertySheets()

    manage_options=(
        {'label': 'Subobjects', 'action'
:'propertysheets/subobjects/manage'},
        )

and then register ZMyObjectManager as a base class in __init__.py?  Or
should I do:

class MyObjectManager(ZClasses.ObjectManager.ObjectManager):
    propertysheets=ZClasses.ObjectManager.ZObjectManagerPropertySheets()

    manage_options=(
        {'label': 'Subobjects', 'action'
:'propertysheets/subobjects/manage'},
        )

and register that as the base class?

-- 
Itamar S.T.  itamars@ibm.net