Re: [sqlalchemy] Colon notation and wildcard conflict

2019-06-20 Thread Cravan
Dear Simon, Thanks for your quick reply and help! It works now. Cravan On 20/6/19, 6:12 PM, "Simon King" wrote: I think you're using postgresql, so you can use ILIKE instead of LIKE to do a case-insensitive search. Simon On Thu, Jun 20, 2019 at 10:43 AM

Re: [sqlalchemy] Colon notation and wildcard conflict

2019-06-20 Thread Simon King
I think you're using postgresql, so you can use ILIKE instead of LIKE to do a case-insensitive search. Simon On Thu, Jun 20, 2019 at 10:43 AM Cravan wrote: > > Thanks Simon, this works for most cases. However, it still does not work in > some cases for example if I want Avengers:Endgame and

Re: [sqlalchemy] Colon notation and wildcard conflict

2019-06-20 Thread Cravan
Thanks Simon, this works for most cases. However, it still does not work in some cases for example if I want Avengers:Endgame and Avengers: Infinity War to come out if I type avengers(lower_cased). How should I rectify this? Cheers, Cravan On 20/6/19, 5:04 PM, "Simon King" wrote: Are you

Re: [sqlalchemy] Colon notation and wildcard conflict

2019-06-20 Thread Simon King
Are you saying that you want to surround the name that the user tried to search for with wildcards? If so, how about this: name = request.args.get("movie.title") name_pattern = "%" + name + "%" search_movie_statement = sqlalchemy.text('SELECT * FROM movies WHERE title LIKE

[sqlalchemy] Colon notation and wildcard conflict

2019-06-20 Thread Cravan
Hi all, I recently tried to create a search function which is supposed to display all possible results in a table even if the title is incomplete. However, I am using python variables and hence have to use colon notation to sub it into the sql command, however I also learnt