peewee无外键连接

#  参考:https://blog.csdn.net/weixin_34273479/article/details/87587183
res = Name.select(Name, User.xxx).join(User, join_type=JOIN.LEFT_OUTER, on=((User.mcc == Name.mcc) & (Name.day == User.day)))

for x in res:
    print(x.user.xxx)
posted @ 2019-06-05 10:16  nanaindi  阅读(376)  评论(2编辑  收藏  举报