[Zope] Dynamic dictionary keys?

Jean Jordaan jean at upfrontsystems.co.za
Tue Feb 28 00:27:05 EST 2006


Hi Andrew

> Allow me to preface this by saying I am a complete newbie to Zope

In that case, please skip DTML and go straight to ZPT. DTML is like
the ghost train in an amusement park, but the ghosts are real. Especially
if you're a newbie.

> <dtml-let eventsDict="{}">
>    <dtml-let calstart="somestring">
>       <dtml-call "REQUEST.set(eventsDict[calstart]=id)">
>    </dtml-let>
> </dtml-let>

Don't code python in a template. Call a Python Script which prepares
your dictionary instead. E.g.
<ul tal:define="eventsDict here/getEvents">...</ul>

-- 
jean


More information about the Zope mailing list