[Zope-PTK] PTK - Putting it all together

Tres Seaver tseaver@palladion.com
Tue, 18 Apr 2000 17:23:46 -0500

Paul Erickson wrote:
> This is a great question.  I'd like to add a bit to it:
> I'd assume that to create a new portal type, you'd inherit from the
> classes that "Control_Panel/Products/DemoPortal/Portal" inherited from.
> If you look at it's base classes, they are ZObject,
> _ZClass_for_DemoPortalBase, and _ZClass_for_PortalObjectBase.  Since the
> _ZClass_for* classes aren't in python anywhere, and they don't show up on
> the list of classes to inherit from (for a new ZClass), then where are they
> defined, and how can they be used?
> I can see that they must be derived from DemoPortalBase and
> PortalObjectBase, but don't know how.

The "_ZClass_for_*" classes are "shims", created when the corresponding Python
classes are registered as base classes by their products (see the
registerBaseClass() method in $ZOPE_HOME/lib/python/App/ProductContext.py).  You
can, in essence, ignore them, and imagine that the ZClass which you make is
derived directly from the equivalent Python base class.

Tres Seaver  tseaver@digicool.com   tseaver@palladion.com