1
一個簡單的問題。我有3種型號:每個作者在django中的每個作者的書數
class Author(models.Model):
name = models.CharField(max_length=250)
class Genre(models.Model):
name = models.CharField(max_length=250)
class Book(models.Model):
title = models.CharField(max_length=250)
author = models.ForeignKey(Author)
genre = models.ForeignKey(Genre)
我怎會跟一個內容的模板:
Author1:
Genre1 - book count
Genre2 - book count
...
Author2:
Genre1 - book count
Genre2 - book count
...
優秀的答案!謝謝! – maksymov 2011-05-07 21:56:19