How to do query with `WHERE value IN list` in the Python Peewee ORM?
You can also do "IN" expressions with a subquery. For example, to get users whose username starts with "a":
a_users = User.select().where(fn.Lower(fn.Substr(User.username, 1, 1)) == 'a')
The .in_()
method signifies an "IN" query
a_user_tweets = Tweet.select().where(Tweet.user.in_(a_users))
See http://peewee.readthedocs.io/en/latest/peewee/query_operators.html