[Zope] ZClasses and automatic sub-objects

Dieter Maurer dieter@handshake.de
Sat, 17 Feb 2001 15:19:55 +0100 (CET)


Tim Moore writes:
 > I have an ObjectManager-derived ZClass.  I would like all instances of
 > this ZClass to have a subobject added to them automatically at
 > creation time.
This is easy. Already answered by someone else...

 > Preferably, this object would a permanent part of each instance...you
 > wouldn't be able to delete or rename it in any instance, but you would
 > be able to edit it (e.g., upload image data).
This is much more difficult.

  You could try to override the ZClass' delete and rename methods.

  The problem will be how to access the original methods
  when you want to operate on non-special objects.

  This has been asked several times in the mailing lists
  (mostly zope-dev, maybe zope, too).
  But I cannot remember a solution.


Dieter