[Zope] Dynamic Folders in <dtml-in>
Dieter Maurer
dieter@handshake.de
Wed, 21 May 2003 21:23:01 +0200
Dieter Fischer wrote at 2003-5-21 17:49 +0200:
> <dtml-set query="sql.oracle.browse()"> #1 See bottom
> <dtml-in "query" size=12 start=query_start>
>
> which works fine.
>
> I'd like to have it more dynamicly, so I tried:
>
> <dtml-set query_string="'sql.'+getDatabase()+'.browse()'"> #1 See bottom
You call for "Computed attribute access".
Pythons "getattr" function implements it.
In DTML, its available as "_.getattr".
In your case, its use looks like:
<dtml-set query="_.getattr(sql,getDatabase()).browse()">
Dieter