扫码关注官方订阅号
闭关修行中......
perhaps you can use select with related and then convert the results to list
简化的
def A(Model): title=field() other1=field() other2=field() def B(Model): a=field(A) b=field() c=field() query_list = B.object.value_list('b','c','a__title','a__other1','a__other2')
query_list就是一个list,返回的结果是元组(id,b,c,a__title,a__other1,a__other2),也可以用values代替value_list返回的是[{'id':1,'b':'11'..},{'id':2,'b':'22'..}]
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
perhaps you can use select with related and then convert the results to list
简化的
query_list就是一个list,返回的结果是元组(id,b,c,a__title,a__other1,a__other2),
也可以用values代替value_list返回的是[{'id':1,'b':'11'..},{'id':2,'b':'22'..}]