gpt4 book ai didi

python - Peewee 的 Where 子句中的 IN 条件

转载 作者:行者123 更新时间:2023-11-29 14:10:59 38 4
gpt4 key购买 nike

我想为 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/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com