[Zope] hide nested classes in a python products -- how?

Dieter Maurer dieter@handshake.de
Tue, 12 Nov 2002 20:21:06 +0100


Tobias Herp writes:
 > ...
 > Is it possible to prevent the further classes to show up in the normal
 > list, so that only 'portal's can be added to a normal Folder object? Or is
 > the only solution to throw an exception?
I see two options:

  *  you do not register your (subordinate) classes and
     define the method "all_meta_types" in your top class.
     "all_meta_types" describes the meta types that can be
     added to your top class.

     See "OFS.ObjectManager.ObjectManager.all_meta_types", for details.

  *  you register your (subordinate) classes but use "visibility=None"
     (I think, it is that name, but I am not sure).

     You can then access them via the interface, they implement.

     Look at "PluggableIndexes", for an example.


Dieter