[Zope] introspection and DatabaseResults objects

Dieter Maurer dieter@handshake.de
Fri, 7 Dec 2001 01:25:59 +0100


Tom Smith writes:
 > ... accessing the names and values of ZSQL method result records ...

   <dtml-let result=_SQLMethod_
           column_names="result.names()">
    <dtml-in result>
      <dtml-let row=sequence-item>
        <dtml-in column_names>
	  <dtml-let column_name=sequence-item>
	     <dtml-var column_name>: <dtml-var "_.getattr(row,column_name)">
	  </dtml-let>
	</dtml-in>
      </dtml-let>
    </dtml-in>
  </dtml-let>

In short:

  the results "names" method to get the column names (of the result set)

  a "Computed Attribute Access" (_.getattr) to get the column values of
  a row.


Dieter