[Zope] Dynamic dictionary keys?

Andrew Hedges andrew at clearwired.com
Mon Feb 27 11:56:49 EST 2006


Allow me to preface this by saying I am a complete newbie to Zope (I  
prefer to think of it as beginner's mind...).  What I am attempting  
to do is dynamically add items to a dictionary, but Zope complains  
"keyword can't be an expression".  Here's the reduced case of my code:

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

This kind of construct *seems* perfectly reasonable, yet it doesn't  
work.  Any suggestions?  Other possible ways of doing the same thing?

Thanks!
-Andrew
-----
Andrew Hedges, Clearwired Web Services
andrew at clearwired.com / http://clearwired.com/




More information about the Zope mailing list