[Zope] programmatically adding documents and properties

Kevin L kevinsl@yahoo.com
Wed, 25 Jul 2001 16:26:19 -0700 (PDT)


Oops I just noticed a type in my message. My code sample should
be:

---------------------------------------
folder_name = 'test_folder'
document_name = 'test_document'

context.manage_addFolder(folder_name, 'folder title')
f = getattr(context, folder_name)
f.manage_addDTMLDocument(document_name,'document title')
' what to do here? I think it should be:
'   f.getattr(context,document_name).manage_addProperty(etc)
' but it's not working
print 'done'
return printed
-----------------------------------------



--- Kevin L <kevinsl@yahoo.com> wrote:
> Hi,
> 
> I want to do the following from a Python Script:
> 
> - create a Folder
> - create a DTML Document within that folder
> - add a property to this new DTML Document
> 
> I've got it all working except the last part.
> 
> here's my code:
> 
> ---------------------------------------
> folder_name = 'test_folder'
> document_name = 'test_document'
> 
> context.manage_addFolder(folder_name, 'folder title')
> f = getattr(context, folder_name)
> f.manage_addDTMLDocument(folder_name,'document title')
> ' what to do here? I think it should be:
> '   f.getattr(context,document_name).manage_addProperty(etc)
> ' but it's not working
> print 'done'
> return printed
> -----------------------------------------
> 
> I'm just having trouble getting the new document object that's
> just been created. Can someone help?
> 
> thanks much
> 
> -Kevin
> 
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo!
> Messenger
> http://phonecard.yahoo.com/
> 
> _______________________________________________
> 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 )


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/