[Zope] simple python script question

Troy Farrell troy@entheossoft.com
Mon, 26 May 2003 23:42:57 -0500


Did you try

template = 'template_1'
obj = container.template_folders[template]

or

template = 'template_1'
obj = getattr(container.template_folders,template)

Troy

Henny van der Linde wrote:
> Hi,
> 
> I have this in a python script to copy/clone a folder.
> 
> obj=container.template_folders.template_1
> pag=context.manage_clone(obj,id)
> pag.manage_changeProperties(title=title)
> 
> This works fine but here template_1 is hardcoded. How do I turn the last
> segment into a variable so I can call this script with a specific folder to
> clone?
> 
> thanks,
> 
> Henny van der Linde
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )