[Zope-dev] Writing custom folderish products

Martijn Pieters mj@antraciet.nl
Mon, 22 Nov 1999 16:51:02 +0100


At 16:17 22-11-99 , Martijn Faassen wrote:
>Right. Now that the Other Martijn is here anyway, could you please help
>me with my custom folder problem? :)

You're in luck, I've got a few minutes. =)

all_meta_types is used to determine what objects are addable. It simply 
returns any acquired property _product_meta_types (which is filled with 
initialized products, I think) and the meta_types proprty.

It returns list of dictionaries with 'name' and 'action' entries. 
lib\python\ZClasses\Property.py for example does what you want like this:

     meta_types=(
         Globals.Dictionary(name=ZCommonSheet.meta_type,
                            action='manage_addCommonSheetForm'),
         )

     def all_meta_types(self): return self.meta_types

which shows also how to have objects that cannot be added anywhere else. 
Just don't register them with context.registerClass, only reference their 
constructor  in the dictionary returned by meta_types.

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| T: +31 35 7502100 F: +31 35 7502111
| mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
---------------------------------------------