If you're planning on distributing this, the best solution may be to define a "folderish" object that can only contain instances of the products you are defining. In a nutshell, you inherit the characteristics of the built-in Folder object and override the methods you want to behave differently. Once you've done this, you can impose just about any restrictions you wish. If you're not distributing this, it may just be sufficient to restrict add privileges on the folder in question to people who can be trusted to make 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ält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich 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 )