[Zope] How to limit types of classes added to a Folder

Chris Withers lists at simplistix.co.uk
Tue Mar 23 04:17:49 EST 2004


(please don't post in HTML)

Russell Fine wrote:

> I'm building a class (Site) that contains a Folder (Called screenshots) 
> in which I will be storing instances of a class I've built called 
> ScreenShot.  The problem is that I can't figure out how to make the 
> Folder interface in the ZMI limit the instance types to ScreenShot.  In 
> the Site class __init__ method, I have :
>  
>         OFS.Folder.manage_addFolder(self, 'screenshots', 'Screen Shots')
>         self.screenshots.meta_types=('ScreenShot')

You need to have  ScreenShotFolder that subclasses Folder and provides a 
different method for all_meta_types (or something like that, I may be off base 
with the name).

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk




More information about the Zope mailing list