Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A Zope Python Script that converts a Plone News Item to a Press Release
## 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
You can’t perform that action at this time.