[Zope] Python-Script Question

Bak @ kedai kedai@kedai.com.my
Sun, 9 Jun 2002 16:35:02 +0800


-----Original Message-----
From: Peter Lohmann <listenmann@elrond.lohmann-services.de>
To: zope@zope.org <zope@zope.org>
Date: Sunday, June 09, 2002 1:53 AM
Subject: [Zope] Python-Script Question


>Hi!
>
>I have the following directory structure
>
>layout 
>|
>`-- retro
>`-- classic
>`-- somethingelse
>
>I want to get the objects inside one of the style-directory from a
>python program, chosen by a variable that is set.
>
>So i have a variable style="retro" and I want to access the objects in
>the retro-Folder. What do I do?
>Normally I would access the contents via
>context.layout.retro.objectValues() - now i need something like
>context.layout.(style).objectValues().
>Is this possible? How?
<untested>
o=getattr(context.layout.retro,'whatyouwant')
return o #will return the object whatyouwant
</untested>
>
>Bye
>
>Peter
>
>
>_______________________________________________
>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 )
>