[web2py] Re: Multiple like clauses

2012-12-06 Thread Joel Samuelsson
You are probably correct! The problem here is legacy though. Changing that column now, means a lot of work. Thank you both for your replies! Den tisdagen den 27:e november 2012 kl. 20:40:41 UTC+1 skrev Joe Barnhart: > > I think niphlod is correct. The query you have chosen is rather difficult >

[web2py] Re: Multiple like clauses

2012-11-27 Thread Joe Barnhart
I think niphlod is correct. The query you have chosen is rather difficult in SQL. The "contains" function maps onto the SQL "like" syntax, and that has no ability to handle a list of targets, only a single string with wildcards. To achieve the effect you want, you essentially have to create

[web2py] Re: Multiple like clauses

2012-11-26 Thread Niphlod
you need to build the query dinamically queries = [] for segment in mylist: queries.append(db.mytable.myfield.startswith(segment)) query = reduce(lambda a,b:(a|b),queries) results = db(query).select() Il giorno lunedì 26 novembre 2012 12:58:29 UTC+1, Joel Samuelsson ha scritto: > > I have