[Zope] ANN: Comparison operators in <dtml-sqltest>

Christopher Petrilli petrilli@digicool.com
Wed, 22 Sep 1999 15:51:57 -0400


> Here's the first cut of my patch to add different comparison operators to
> dtml-sqltest.  This will allow you to write SQL methods like:
>
> SELECT *
> FROM bar
> WHERE <dtml-sqltest foo op=like type=string>
>
> which will generate code like this:
>
> SELECT *
> FROM bar
> WHERE foo like 'Baz%'
>
> You can also use all the other comparison operators like <, <=, >, >=, <> etc.
>
> You can get the patch at:
>   http://www.zope.org/Members/hughe
>
> Comments, suggestions, bug-fixes welcome.

Don't know if you track the CVS repository, but I checked in your patch,
with a minor modification, it now inserts op=foo even if it's not in the
list so you can say:

    <dtml-sqlvar foo op=">=" type=string>

or even:

    <dtml-sqlvar foo op=bar type=string>

and get:

    foo bar "blah"

Anyway, thanks for this, we'd talked about it, but never gotten around to
this!

Chris
--
| Christopher Petrilli        Python Powered        Digital Creations, Inc.
| petrilli@digicool.com                             http://www.digicool.com