[Zope] Document Library: Changing Properties

Steve Spicklemire steve@spvi.com
Thu, 29 Nov 2001 05:48:41 -0500


Hi Jason,

	I don't know a thing about Document Library but you can probably 
acquire it (is it folderish?) It may have some special API for getting 
documents. You may need to inspect its source to find out. Assuming it's 
"folderish" you could do something like

for doc in context.myDocumentLibrary.objectValues():
	doc.manage_changeProperties(y=doc.x)

This will change *all* the objects in the folder "myDocumentLibrary". If 
you want to get only certain meta_types, you can pass in a list of 
meta_types that you want, e.g.,

for doc in context.myDocumentLibrary.objectValues('DTML Document'):
	doc.manage_changeProperties(y=doc.x)

anyway... good luck!
-steve

On Thursday, November 29, 2001, at 02:28 AM, Jason C. Leach wrote:

> hi,
>
> I have 108 documents in a Document Library (product). I need to go 
> through
> them all and set one propertie equal to another. Something like
> document.x = document.y. I figure this is a good time to learn python 
> scripting
> in zope. I don't know how to get the documents into my script, then back
> out.
>
> Any help would be appreciated.
>
> Thanks,
> j.
>
>
> --
> ......................
> ..... Jason C. Leach
> ..
>
> PGP/GPG Public key at http://www.keyserver.net/
> Key ID: 157BD48C
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )