如何在peewee中选择虚拟列? [英] How to select dummy column in peewee?
本文介绍了如何在peewee中选择虚拟列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
操作方法
select 'blah' as dummycolumn
在小矮人里?
我尝试过
MyTable.select('blah')
但它不起作用
推荐答案
MyModel.select(
MyModel.some_field.alias('another_name'),
Value('a string literal').alias('a_string'),
Value(12345).alias('a_number'))
这篇关于如何在peewee中选择虚拟列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文