Skip to content

Instantly share code, notes, and snippets.

@pigeonflight
Created May 3, 2011 13:08
Show Gist options
  • Save pigeonflight/953299 to your computer and use it in GitHub Desktop.
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
## 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