我想为 Python 的 Peewee ORM 中的 where 子句完成类似于 SQL“IN”条件的操作。
Order.select().where(Order.statusid in statuses)
这可能吗?
我正在使用 Postgres,以防与任何建议的解决方案存在任何兼容性问题。
最佳答案
这也行:
Order.select().where(Order.statusid << statuses)
比实际的 .in_ 方法更优雅:)
关于python - Peewee 的 Where 子句中的 IN 条件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30605045/