📅  最后修改于: 2022-03-11 15:05:26.551000             🧑  作者: Mango
queryset=country_model.objects.raw('SELECT myapp_country_model.cname,myapp_state_model.sname FROM myapp_country_model INNER JOIN myapp_state_model on myapp_country_model.id=myapp_state_model.cid_id')
Solution
queryset=country_model.objects.raw('SELECT myapp_country_model.id,myapp_country_model.cname,myapp_state_model.sname FROM myapp_country_model INNER JOIN myapp_state_model on myapp_country_model.id=myapp_state_model.cid_id ')