[Zope] enumerating fields

Mark McEahern mmceahern@yahoo.com
Thu, 14 Jun 2001 20:12:06 -0700 (PDT)


Q:  How do you enumerate and display the field NAMES
in a SQL result set?

Suppose you have a ZSQLMethod, getSightings (from
Lesson 11 in the Zope Tutorial).  What I'd like to do
is enumerating the fields in the results of this query
to display the field names (without knowing them). 
Here's what I tried, but it doesn't work (in
particular, note the sequence-start block):

<dtml-var standard_html_header>
<h2><dtml-var title></h2>

<table border=1>
<dtml-in getSightings>
<dtml-if sequence-start>
<tr>
<dtml-in sequence-item>
<td><dtml-var sequence-key></td>
</dtml-in>
</tr>
</dtml-if>
<tr>
<dtml-in sequence-item>
<td><dtml-var sequence-item></td></dtml-in>
</tr>


<dtml-comment>
<p><dtml-var date> -- <dtml-var location></p>
<p>Reported by <dtml-var name></p>
<p><dtml-var description></p>
</dtml-comment>

</dtml-in>
</table>
<dtml-var standard_html_footer>

Any ideas?

Thanks,

Mark

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/