Reverse version of sql LIKE in sqlalchemy
mysql, sql, sql-like, sqlalchemy
Solution
Thanks to this question, I figure out how to do that :)
session.query(Book).
filter(bindparam('book_title', book.title).contains(Book.title)).first()
Problem
By "reverse version of like" I mean exactly like this question. The question is how to make a query like that in sqlalchemy? I found out that to make "SELECT LIKE" query in sqlalchemy I should make something like that ``` session.query(Book).filter(Book.title.like("%"+my_title+"%")) ``` Because `like` is method of column, I don't know how to use `like` method to ask about `"%" + Book.title + "%"`.