[Zope-dev] Restricting Sub-Objects in Folders DYNAMICALLY?

Brian Oliver beef005@hotmail.com
Sat, 16 Mar 2002 20:18:32 +1000


I would like to restrict the types of objects (from a python-based product) 
that may be placed in Folders, or any other dumb container, based on certain 
conditions.

For example:  I'd like to restrict the number of a certain type of object 
that may appear in a folder.  The end-user can add up to the limit, and 
afterwards the object type should NO LONGER APPEAR in the "Add List".

I've thought about building a specialized folder, but I'd rather not.  Zope 
already has a good folder with all the things I need.

What Zope 2.4+ really needs to do is callback a provided function to 
determine if a particular class is allowed in a specified container instance 
(or class)

Using the "implements" parameter of the registerClass method is not enough 
as it only permits static checking.

Any help would be greatly appreciated.

Regards

-- Brian





_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com