views:

131

answers:

1

Is there a pretty way to execute an SQL statement with a LIKE clause in SQLObject? This one:

    fields = Foo.select("field LIKE '%%%s%%'" % bar)

works, but it's somewhat ugly.

A: 

SqlBuilder has a LIKE function (and also startswith and endswith ones that build appropriate LIKE clauses).

Alex Martelli