[Zope] Arrg! dtml-in can't handle lists of pairs!
Cary O'Brien
cobrien@Radix.Net
Sat, 1 Jul 2000 13:27:58 -0400 (EDT)
Ok. I get a list of rows from a database query. I want
to iterate over the rows. If there are 3 or more
columns in the table, everythin is fine. If there are 2
columns, it doesn't work.
It seems as if dtml-in handles lists of pairs specially.
Not a good thing. Can I supress this behavior?
Here is an example of this:
-------------------
<h4>Iterate over 3.tuples</h4>
<dtml-let list="[('a','b','c'),('d','e','f')]">
<dtml-in list>
<dtml-var sequence-item><br>
<dtml-in sequence-item>
> <dtml-var sequence-item></br>
</dtml-in>
</dtml-in>
</dtml-let>
<h4>Iterate Over 2-tuples</h4>
<dtml-let list="[('a','b'),('c','d')]">
<dtml-in list>
<dtml-var sequence-item><br>
<dtml-try>
<dtml-in sequence-item>
> <dtml-var sequence-item></br>
</dtml-in>
<dtml-except>
<h4>Why can't I do this!</h4>
</dtml-try>
</dtml-in>
</dtml-let>
<h4>Iterate Over 1-tuples</h4>
<dtml-let list="[('a',),('b',)]">
<dtml-in list>
<dtml-var sequence-item><br>
<dtml-in sequence-item>
> <dtml-var sequence-item></br>
</dtml-in>
</dtml-in>
</dtml-let>
-----------------------
-- cary