[Zope-DB] using dtml-if in ZSQL method
Dieter Maurer
dieter@handshake.de
Thu, 14 Nov 2002 21:05:40 +0100
Jeff Kowalczyk writes:
> How do I use dtml-if to conditionally insert an order by sort order modifier? Passing
> reverse=1 to this method doesn't give the desired insertion.
> ...
> order by <dtml-var sort sql_quote> <dtml-if expr="reverse==1">desc</dtml-if>
Almost surely, your pass "reverse=1" as a string.
But the string "'1'" is not equal to the integer "1".
Pass the value for "reverse" as an integer and it will work.
Dieter