[Zope] DTML question

Martijn Pieters mj@antraciet.nl
Thu, 01 Apr 1999 12:53:33 +0200


At 04:35 01/04/99 , TFE MMS JARVIS JOHN wrote:
> I'm still left with a question, though: How would you go about using
> sequence-item, etc. in a python expression? Python sees it as
> 'sequence minus item' and I get a 'Name Error: sequence' exception.
>
>I was wanting to do something like this:
>
><table>
>  <!--#in "dictionary.keys()"-->
>    <tr>
>       <td><!--#var sequence-item--></tr>
>       <td><!--#var "records[sequence-item]"--></td>
>    </tr>
>  <!--#/in--> 
></table>
>
>Which seems natural to me but, of course, doesn't work.
>I have the feeling that I might need this in something like 
>
><!--#if "sequence-item=='gotcha!'"-->Ouch!<!--#/if--> 
>

Try this:
<table>
  <!--#in "dictionary.items()"-->
    <tr>
       <td><!--#var sequence-key--></tr>
       <td><!--#var sequence-item--></td>
    </tr>
  <!--#/in--> 
</table>


--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-6254545 Fax: +31-35-6254555
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------