[Zope] Building a list programmatically under DTML

Martijn Pieters mj@antraciet.nl
Tue, 07 Sep 1999 15:00:12 +0200


At 14:45 07/09/99 , Evan Simpson wrote:
>Martijn Pieters wrote:
>
> > And straight again =):
>
>[snip]
>
> > But, you can't change a dictionary after creating it.
>
>And one last teensy straightening <wink>.  You can use the update method of
>dictionaries to change them, thus:
>
><dtml-call "REQUEST.set('letsgo', {1: 'a one'})">
><dtml-call "letsgo.update({2: 'and a two'})">
><dtml-call "letsgo.update({(1,2,3,4): 'and a one, two, three, four!'})">
>
>You cannot, AFAIK, delete keys from DTML.  You can make a new copy of the
>dictionary with only selected keys, but you're better off in External Methods
>(soon PythonMethods!)

Aaarg. I knew I should've checked the Library Reference as well.. =)

Evan, you're King.

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