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

Dylan Reinhardt zope@dylanreinhardt.com
Mon, 11 Nov 2002 10:39:26 -0800


If you're planning on distributing this, the best solution may be to define=
=20
a "folderish" object that can only contain instances of the products you=20
are defining.  In a nutshell, you inherit the characteristics of the=20
built-in Folder object and override the methods you want to behave=20
differently.  Once you've done this, you can impose just about any=20
restrictions you wish.

If you're not distributing this, it may just be sufficient to restrict add=
=20
privileges on the folder in question to people who can be trusted to make=20
the correct choices.

HTH,

Dylan

At 07:14 PM 11/11/2002 +0100, you wrote:
>Hi,
>
>I'm re-implementing my nested ZClass product as a python product.
>
>The ZClass product contains a class 'portal' which is the only one which
>should be add-able to any ordinary folder, and a cascade of further classes
>which can be added inside the portal.
>
>In my classes I'm able to restrict the list of contained classes via
>_allowed_meta_types. But in an ordinary Folder, any object can be added.
>
>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?
>
>tia,
>
>Tobias
>--
>(sorry for any unfriendly footer added automatically against my wishes...
>please ignore it!)
>
>
>Diese E-Mail enth=E4lt vertrauliche und/oder rechtlich gesch=FCtzte
>Informationen. Wenn Sie nicht der richtige Adressat sind oder
>diese E-Mail irrt=FCmlich erhalten haben, informieren Sie bitte
>sofort den Absender und vernichten Sie diese Mail. Das un-
>erlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail
>ist nicht gestattet.
>
>This e-mail may contain confidential and/or privileged
>information. If you are not the intended recipient (or have
>received this e-mail in error) please notify the sender
>immediately and destroy this e-mail. Any unauthorised copying,
>disclosure or distribution of the material in this e-mail is
>strictly forbidden.
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://lists.zope.org/mailman/listinfo/zope
>**   No cross posts or HTML encoding!  **
>(Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )