[英]python peewee query, with column name as variable
Peewee query is as following: Peewee查询如下:
q = AccountTab.get(AccountTab.id == 12345)
print(q.name)
What if name
here is stored in a variable, say user_name
. 如果此处的
name
存储在变量中,例如user_name
,该怎么办? Is there something like this? 有这样的东西吗?
q = AccountTab.get(AccountTab.id == 12345)
print(q.#{user_name})
Thanks for your time! 谢谢你的时间!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.