Is it possible to test for the presence of two variables in a single <dtml-if> tag, and if so could someone point me in the right direction? kind regards garry
<dtml-if expr="REQUEST.has_key('variable1') and REQUEST.has_key('variable2')"> ... </dtml-if> should do it. On Sun, 6 Mar 2005, garry saddington wrote:
Is it possible to test for the presence of two variables in a single <dtml-if> tag, and if so could someone point me in the right direction? kind regards garry _______________________________________________ Zope maillist - Zope@zope.org 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 )
On Sunday 06 March 2005 19:53, Dennis Allison wrote:
<dtml-if expr="REQUEST.has_key('variable1') and REQUEST.has_key('variable2')"> ... </dtml-if>
should do it. Thanks but i need to do this in a ZSQL method: result is from the :records directive in a form there can be many records returned. <dtml-in result> <dtml-var sql_delimiter>
<dtml-if expr="_.has_key(examandterm) and _.has_key(exampercentage)"> insert into examresults (teacherid,studentid,classid,examgrade,exampercentage,examposition) values( <dtml-sqlvar teacherid type="int">, <dtml-sqlvar studentid type="int">, <dtml-sqlvar classid type="int">, <dtml-sqlvar examgrade type="string">, <dtml-sqlvar exampercentage type="int">, <dtml-sqlvar examposition type="int"> ) </dtml-if> </dtml-in> any help will be much appreciated. regards garry
On Sun, 6 Mar 2005, garry saddington wrote:
Is it possible to test for the presence of two variables in a single <dtml-if> tag, and if so could someone point me in the right direction? kind regards garry _______________________________________________ Zope maillist - Zope@zope.org 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 )
garry saddington wrote:
<dtml-in result> <dtml-var sql_delimiter>
<dtml-if expr="_.has_key(examandterm) and _.has_key(exampercentage)">
I presume this is the code you're havingtrouble with? If so, what are you trying to do, and where to examandterm and exampercentage come from? cheers, Chris PS: maybe try: <dtml-if expr="result.examandterm and result.exampercentage"> -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (3)
-
Chris Withers -
Dennis Allison -
garry saddington