Comment 2 for bug 387840

Revision history for this message
Stuart Bishop (stub) wrote : Re: [Bug 387840] Re: CONTAINSSTRING should move to storm.expr

On Thu, Jun 18, 2009 at 10:38 PM, James
Henstridge<email address hidden> wrote:
> I think it might be useful to add startswith(), endswith() and
> containsstring() methods to Comparable, implemented with LIKE similar to
> CONTAINSSTRING().  That would allow more natural usage (e.g.
> store.find(Table, Table.column.startswith("foo"))).
>
> If Comparable.__contains__() could work for "substring in column" type
> expressions, then that might be even better (although wouldn't allow for
> a case_sensitive optional argument).

store.find(Table, Table.column.lower.startswith(somestring.lower()))
would be the case insensitive version, wouldn't it?

--
Stuart Bishop <email address hidden>
http://www.stuartbishop.net/