[Zope] simple python script question

Sébastien Georget sebastien.georget@ensmp.fr
Tue, 27 May 2003 09:03:35 +0200


A 23:42 26/05/2003 -0500, vous avez écrit :
>Did you try
>
>template = 'template_1'
>obj = container.template_folders[template]
>
>or
>
>template = 'template_1'
>obj = getattr(container.template_folders,template)
>
>Troy
>

Is there a function to do the same with a path ?
For example :
   template = 'template_folder/template_1'
   xxxfunction(portal, template)

Currently I split the template var and make a loop over a getattr call. Is 
there a better way to do it ?

thx

Sébastien Georget
http://purl.org/NET/Georget/Sebastien