[Zope-dev] filter metatypes in objectmanager

Jens Vagelpohl jens@digicool.com
Tue, 27 Mar 2001 07:58:52 -0500


define a method with the name "all_meta_types" inside your class and have it
return the correct information, like this:

********

import Products

    def all_meta_types(self):
        """ What can you put inside me? """
        f = lambda x: x['name'] in ('DTML Method', 'DTML Document')
        return filter(f, Products.meta_types)

********

Products.meta_types contains information about all available meta types and
you need to filter out what you need.

jens




on 3/27/01 7:44, Magnus Heino at magnus.heino@rivermen.se wrote:

> 
> How can I control what meta_type's that can be added to an ObjectManager?
> 
> If you create a ZClass that inherits from ObjectManager, you can specify
> this, but how is it done from a python product?
> 
> /Magnus