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

2002-03-19 Thread Ivo van der Wijk

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 )



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

2002-03-16 Thread Gary Poster

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?

2002-03-16 Thread Max M

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 )