Created
May 3, 2011 13:08
-
-
Save pigeonflight/953299 to your computer and use it in GitHub Desktop.
A Zope Python Script that converts a Plone News Item to a Press Release
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Script (Python) "convert_news_to_press" | |
##bind container=container | |
##bind context=context | |
##bind namespace= | |
##bind script=script | |
##bind subpath=traverse_subpath | |
##parameters= | |
##title=Convert to News Items to Press Releases | |
## | |
source_contenttype = 'News Item' | |
target_contenttype = 'PressRelease' | |
items = context.listFolderContents(contentFilter={"portal_type" : source_contenttype}) | |
for item in items: | |
id = "%s-new" % item.getId() | |
title = item.Title() | |
description = item.Description() | |
text = item.getText() | |
service = context.invokeFactory(target_contenttype, id, | |
title=title,description=description,text=text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment