[Zope] Parameterizing dtml-sqltest's column?

Richard Wesley hawkfish@electricfish.com
Fri, 25 Oct 2002 08:57:31 -0700


I would like to write a general purpose table row extractor and the 
column parameter to dtml-sqltest is driving me crazy.  Here is what I 
would _like_ to do (simplified slightly):

<params>Table Row</params>
select *
from <dtml-var Table>
<dtml-sqlgroup where>
   <dtml-if Row>
     <dtml-in expr="Row.keys()">
       <dtml-unless sequence-start>and</dtml-unless>
       <dtml-let Value="Row[_.getitem('sequence-item')]">
         <dtml-sqltest Value column="_.getitem('sequence-item')" type=string>
       </dtml-let>
     </dtml-in>
   </dtml-if>
</dtml-sqlgroup>

But this expands to having the column equal to the literal text 
"_.getitem('sequence-item')", i.e. no interpretation is done.

Is there a way to do this or do I have to leave all my SQL unprotected?

TIA,
Sincerely,

Richard Wesley
Co-President, Electric Fish, Inc.
<http://www.electricfish.com/>
(v) +1-206-493-1690x210
(f) +1-206-493-1697