How to select dummy column in peewee?

佐手、 提交于 2019-12-02 04:31:11

问题


how to do

select 'blah' as dummycolumn

in peewee??

I have tried

MyTable.select('blah')

but it is not working


回答1:


MyModel.select(
    MyModel.some_field.alias('another_name'),
    Value('a string literal').alias('a_string'),
    Value(12345).alias('a_number'))


来源:https://stackoverflow.com/questions/36395229/how-to-select-dummy-column-in-peewee

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!