我有这个 SQL 查询,需要在 django orm 中执行
select count(*), tabel_d.name from tabel_a join tabel_ on tabel_b.id = tabel_a.b_id join tabel_c on tabel_c.b_id = tabel_b.id join tabel_d on tabel_d.id = tabel_c.d_id group by tabel_d.id
如何做到这一点?