テンプレートからアクセスしたい3つの「レイヤー」ディープモデルがあります。
モデル:
class Match(models.Model):
pl1 = models.IntegerField(default=0)
pl2 = models.IntegerField(default=0)
boards = models.ManyToManyField(Scoreboard)
active = models.IntegerField(default=1)
turn = models.IntegerField(default=0)
def __unicode__(self):
return "Match " + str(self.id)
class Scoreboard(models.Model):
user = models.ForeignKey(User)
推測しているだけですが、各「一致」に接続しているユーザーの名前を取得するには、次のようにすべきではありません。
{% for active in matches %}
{{active}} - {{active.boards.user}}<br>
{% endfor %}