19 Dec
2002
19 Dec
'02
7:11 p.m.
Stacy Roberts Ladnier writes:
I have created a Product made up of hundreds of classes. Each class has restrictions that should only allow a certain few meta_types to be added. Give your classes an "all_meta_types" method, similar to the following:
def all_meta_types(self): return ( { 'name' : PortalConfig.meta_type, 'action': 'PortalConfig_add', 'permission': ManagePortal, }, ) I.e. "all_meta_types" should return a sequence of dictionaries. Each dictionary describes an allowed meta type, "name" gives its name (meta_type), "action" the URL to the constructor, "permission", the permission necessary to be allowed to add this meta type. Dieter