【问题标题】:How to select dummy column in peewee?如何在peewee中选择虚拟列?
【发布时间】:2016-04-04 05:38:46
【问题描述】:

怎么做

select 'blah' as dummycolumn

小便??

我试过了

MyTable.select('blah')

但它不起作用

【问题讨论】:

    标签: python mysql orm peewee


    【解决方案1】:
    MyModel.select(
        MyModel.some_field.alias('another_name'),
        Value('a string literal').alias('a_string'),
        Value(12345).alias('a_number'))
    

    【讨论】:

      猜你喜欢
      • 2010-11-08
      • 1970-01-01
      • 2018-12-02
      • 1970-01-01
      • 2020-11-14
      • 2018-03-24
      • 1970-01-01
      • 1970-01-01
      • 2012-11-12
      相关资源
      最近更新 更多