[Zope-CMF] dynamic list of content-types for the zope ZMI

Oliver Bleutgen myzope@gmx.net
Tue, 08 Jan 2002 19:14:47 +0100


Tres Seaver wrote:


>   # Generate list of type names based on 'Foo' metatype.
>   type_objs = getToolByName( self, 'portal_types' )
>   my_types = filter( lambda x: x.Metatype() == 'Foo', type_objs )
>   type_names = map( lambda x: x.Type(), my_types )
> 
> You can then use 'type_names' to build your add form.


Thanks Tres,
just for the sake of others stumbling upon it in the archives, I think 
it should mean

my_types = filter( lambda x: x.Metatype() == 'PortalContentFolder',
               type_objs.listTypeInfo() )

                          ^^^^^^^^^^


in the second line.

cheers,
olier