Hi,
I have created a folderish content type, and I am creating folders with in
it.
See code snippet from ../content/communityfolder.py:
def at_post_create_script(self):
def publishObject(obj):
portal_workflow = getToolByName(obj, 'portal_workflow')
if portal_workflow.getInfoFor(obj, 'review_state') in
['visible',
'private']:
portal_workflow.doActionFor(obj, 'publish')
return
_createObjectByType('Folder', self, 'cpresources', title="Helpful
Resources", description='Here are some documents and links with general
information concerning community planning.')
theresourcefolder = self.cpresources
publishObject(theresourcefolder)
_createObjectByType('Document', theresourcefolder, 'cp-terms',
title="Planning Term Glossary", description='Planning is a specialized area
with its own terminology - this glossary has definitions that may be
helpful.')
_createObjectByType('Document', theresourcefolder, 'cp-acronyms',
title="Planning Acronyms", description='Acronyms are often used in
government documents - these are some of the most common.')
_createObjectByType('Document', theresourcefolder, 'cpstatus',
title="Definition of Status", description='Each of the community plans has a
status which has one of the following meanings.')
thestatus = self.cpresources.cpstatus
statustext = '<h3>Under Development</h3><p>Being worked
on.</p><h3>Adoption Public Hearing Process</h3><p>Meetings and other
steps</p><h3>Adopted</h3><p>Plan is in effect</p><h3>Undergoing
Update</h3><p>A process allowing changes</p>'
thestatus.setText(statustext)
publishObject(thestatus)
It is working but...I have 2 questions:
1. Is there a programmatic way for me to change one of the folders I created
above (graphics) to use the atct_album_view instead of folder_view?
2. If I create a document inside a created folder, can I make that Page
become the view for the folder?
--
View this message in context:
http://plone.293351.n2.nabble.com/programmatically-changing-views-after-createObjectByType-tp5515867p5515867.html
Sent from the Product Developers mailing list archive at Nabble.com.
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers