peewee:以编程方式构建查询

peewee: building a query programmatically

是否可以(如何?)在 peewee 中以编程方式构建 select 查询?重点是根据需要添加 .where() 子句。

query = SomeThing.select()
if foo:
    query = query.where(SomeThing.value == 'foo')
else:
    query = query.where(...)