[Zope] sequence-key usage
Martijn Pieters
mj@digicool.com
Thu, 24 Feb 2000 06:17:29 -0500
From: Jim Sanford [mailto:snafford@bellsouth.net]
>
> Does anyone know how sequence-key should/can be used within a
> dtml-in construct?
If you pass in a list of 2-item tuples (like [(1,1), (2,1), (3,1)]),
then sequence-key is the first item of every 2-item tuple, and
sequence-item is every second element. This also works for any other
combo of tuples and lists, as long as the contained lists/tuples are two
items long.
<dtml-in "[(1,1), (2,1), (3,1)]">
&dtml-sequence-key;: &dtml-sequence-item;<BR>
</dtml-in>
would print
1: 1
2: 1
3: 1
The objectItems method, for example, returns a list of id, subobject
tuples. sequence-key would then hold the id, and sequence-item the
subobject.
--
Martijn Pieters, Software Engineer
| Digital Creations http://www.digicool.com
| Creators of Zope http://www.zope.org
| mailto:mj@digicool.com ICQ: 4532236
| PGP:
http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
-------------------------------------------