Re: [Zope-dev] Restricting Sub-Objects in Folders DYNAMICALLY?
On Sat, Mar 16, 2002 at 08:18:32PM +1000, Brian Oliver wrote: 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. At this moment, my QuotaFolder only limits the total number of objects, their total size (sorta) and the maximum size of individual objects. Future plans are to restrict installable types in general (i.e. restrict people from installing LocalFS, etc), or to limit the number of these objects. If you want to code something like this yourself, QuotaFolder may be a good startingpoint. I will release the product later this week, but people who want a preview now should email me and I'll send the current version (which basically lacks some documentation) Regards, Ivo -- Drs. I.R. van der Wijk -=- Brouwersgracht 132 Amaze Internet Services V.O.F. 1013 HA Amsterdam, NL -=- Tel: +31-20-4688336 Linux/Web/Zope/SQL/MMBase Fax: +31-20-4688337 Network Solutions Web: http://www.amaze.nl/Consultancy Email: [EMAIL PROTECTED] -=- ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Restricting Sub-Objects in Folders DYNAMICALLY?
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 ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Restricting Sub-Objects in Folders DYNAMICALLY?
Does OrderedFolder do what you want? See http://demo.iuveno-net.de/iuveno/Products/OrderedFolder (item 3 in the list of features). It may or may not be a standard folder feature in 2.6 as well. Gary ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Restricting Sub-Objects in Folders DYNAMICALLY?
Brian Oliver wrote: 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. If you put this in your product: def all_meta_types(self): What types can you add to this objectManager? allowedMetaTypes = ('DTML Document', 'DTML Method') result = [] for metaType in Products.meta_types: if metaType['name'] in allowedMetaTypes: result.append(metaType) return result You can probably modify it to your needs. regards Max M ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )