【问题标题】:peewee: building a query programmaticallypeewee:以编程方式构建查询
【发布时间】:2015-03-03 04:45:48
【问题描述】:

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

【问题讨论】:

    标签: sql peewee flask-peewee


    【解决方案1】:
    query = SomeThing.select()
    if foo:
        query = query.where(SomeThing.value == 'foo')
    else:
        query = query.where(...)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-30
      • 1970-01-01
      • 2023-04-03
      • 1970-01-01
      • 2016-11-18
      • 1970-01-01
      相关资源
      最近更新 更多