[Zope-CMF] how do I manipulate a CMF document programatically?
Tres Seaver
tseaver@palladion.com
Tue, 14 Aug 2001 09:42:19 -0400
Frank McGeough wrote:
> If I have members that have created CMF documents and I want to manipulate
> those documents programatically, how would I proceed?
> An example of the need is suppose I have a bunch of documents that people
> have written that refer to "Fuzzbot Generic Tummy Scratcher" and my company
> renames this to be "Fuzzbot Generic Back Scratcher" as they reposition
> themselves in the Fuzzbot market. I'd like to run a little Python script
> that goes through and replaces the former with the latter but I'm not sure
> how to do this. I can't seem to figure out how to get at the contents of the
> objects.
The 'EditableText' method should give you the raw HTML or StructuredText
of the documents; you would manipulate the value, and then poke it
back in using the 'edit' method (which also requires that you pass the
'text_format').
Tres.
--
===============================================================
Tres Seaver tseaver@zope.com
Zope Corporation "Zope Dealers" http://www.zope.com