次の 2 つのモデルがあるとします。
class Player(Model):
alliance = ForeignKey("Alliance")
points = PositiveIntegerField()
class Alliance(Model):
points = PositiveIntegerField()
すべてのプレイヤーとすべての同盟には、特定の量のポイントがあります。同盟ポイントの合計は countalliance.points + Sum(player_set__points)
です。
私がやりたいことは、合計ポイントの量で注文されたすべての同盟を取得することです。問題は、集計でSum + Sumができないように見えることです。