我刚接触peewee,似乎不知道如何正确地发送查询。
下面是我的Meta:
class Meta:
database = db
db_table = 'profile'据我所知,我告诉peewee使用桌子'profile‘
但是当我尝试使用以下命令从表中进行选择时:
Profile.get(Profile.name == user)我总是收到一个引用表't1‘而不是我的表'profile’的错误
如何告诉peewee使用特定的表而不是t1?
发布于 2017-12-20 04:09:47
Peewee在构造查询时使用别名,所以尽管它引用的是"t1",但查询本身可能如下所示:
SELECT * FROM "profile" AS "t1" WHERE "t1"."name" = '<whatever>';https://stackoverflow.com/questions/47889842
复制相似问题