First. I am finding arrays work fine with select statements in DTML when you use sqlvar to request a specific value from the array.
ie.
SELECT
a_table.an_array_field[<dtml-sqlvar some_value type="int">][2]
FROM ....(rest of query)
But when you put them inside a sqltest tag for evaluating values it throws an error because DTML cannot parse it.
ie.
SELECT ...
blah blah.....
<dtml-and>
<dtml-sqltest column=a_table.an_array_field[<dtml-sqlvar an_array_key type="int">][2] name=a_title_var op="eq" type="string" optional>
..... (rest of query)
The issue is how to test against these values when DTML cannot parse them? My raw sql query works fine giving me the desired results but I cannot construct the statement in DTML.
The part of the query that throws the error is the dtml-sqltest tag (it gives a parsing error). ie.
<dtml-and>
<dtml-sqltest column=a_db.an_array_field[<dtml-sqlvar an_array_key type="int">][2] name=a_title op="eq" type="string" optional>
should translate to:
AND
a_table.an_array_field[1][2] = 'This is a title' (This is a valid expression for Postgres)
where an_array_key is a variable with value of 1 and a_title is variable with a value of 'This is a title'
The above would give an invalid attribute name error for the an_array_key (variable/argument).
Is this a bug or is there something else I ought to be doing? If this is a limitation of DTML, is there a work around?
Regards,
David
_______________________________________________ Zope maillist - [email protected] http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
