[zopeorg-checkins] CVS: Products/ZopeOrg-NV/Extensions - setupZopeOrg.py:1.46

Chris McDonough chrism at zope.com
Thu May 9 14:10:42 EDT 2002


Update of /cvs-zopeorg/Products/ZopeOrg-NV/Extensions
In directory cvs.zope.org:/tmp/cvs-serv23203/Extensions

Modified Files:
	setupZopeOrg.py 
Log Message:
Set allowed types.


=== Products/ZopeOrg-NV/Extensions/setupZopeOrg.py 1.45 => 1.46 ===
     modPyJobsFolder(portal, remove=0)
 
+    log.append('\n * Modifying allowed/filtered types for folderish types')
+    folderish_types=['CMF Wiki', 'Software Product',
+                     'Software Release', 'Jobs Folder', 'Member Folder']
+    setupAllowedTypes(portal, folderish_types)
+
     log.append('\nFinished conversion process!\n\n')
     
     return string.join(log, '\n')
@@ -706,7 +711,7 @@
 
 def modPyJobsFolder(portal, remove):
     """"
-    Modify jobs folder so users can't add them
+    Modify jobs folder so users cant add them
     """
     tt = getToolByName(portal, 'portal_types')
     typesList = tt.listTypeInfo()
@@ -719,3 +724,16 @@
                 tt._delObject(ob.getId())
             else:
                 i.factory = ''
+
+def setupAllowedTypes(portal, folderish_types):
+    types_tool = getattr( portal, 'portal_types' )
+    all_types = types_tool.objectIds()
+
+    for type in folderish_types:
+        ob = getattr(types_tool, type)
+        ob._updateProperty( id='filter_content_types'
+                            , value=0
+                            )
+        ob._updateProperty( id='allowed_content_types'
+                            , value=all_types
+                            )






More information about the zopeorg-checkins mailing list