Back to index

plone3  3.1.7
versioning_config.py
Go to the documentation of this file.
00001 ## Script (Python) "versioning_config"
00002 ##bind container=container
00003 ##bind context=context
00004 ##bind namespace=
00005 ##bind script=script
00006 ##bind subpath=traverse_subpath
00007 ##parameters=policy_map
00008 ##title=versioning config
00009 ##
00010 
00011 enabled_types = []
00012 type_policies = {}
00013 for p_type in policy_map:
00014     if p_type.get('enabled', None):
00015         enabled_types.append(p_type['portal_type'])
00016     if p_type.get('policies', None):
00017         type_policies[p_type['portal_type']] = p_type['policies']
00018 
00019 context.portal_repository.setVersionableContentTypes(enabled_types)
00020 context.portal_repository.manage_setTypePolicies(type_policies)
00021 context.REQUEST.RESPONSE.redirect(context.absolute_url() + '/versioning_config_form')