twitchy
twitchy

Reputation: 21

How to make query with "contains" filter but also case insensetive?

I'm looking for a query filter that will return object that has column for example "FooBar" from database by passing argument "oobar". Haven't found it anywhere :(

Edit: It turned out that "contains" is already case insensetive :O

Upvotes: 0

Views: 45

Answers (1)

mars328
mars328

Reputation: 573

You can use 'ilike' to query like below

model.YOURMODEL.query.filter(Model.column.ilike("oobar"))

Upvotes: 1

Related Questions