Django Book 翻译
菜单>:
TOC
返回
原文:
The exception to the one-class-per-database-table rule is the case of many-to-many relationships. In our example models, ``Book`` has a ``ManyToManyField`` called ``authors`` . This designates that a book has one or many authors, but the ``Book`` database table doesnt get an ``authors`` column. Rather, Django creates an additional table a many-to-many join table that handles the mapping of books to authors.
翻译:
“每个数据库表对应一个类”这条规则的例外情况是多对多关系。在我们的范例模型中, ``Book`` 有一个 ``多对多字段`` 叫做 ``authors`` 。 该字段表明一本书籍有一个或多个作者,但 ``Book`` 数据库表却并没有 ``authors`` 字段。相反,Django创建了一个额外的表(多对多连接表)来处理书籍和作者之间的映射关系。
备注:
译者: