Django Book 翻译
菜单>:
TOC
返回
原文:
If youre using the admin interface, ``ManyToManyField`` instances should go in the object thats going to be edited in the admin interface. In the preceding example, ``toppings`` is in ``Pizza`` (rather than ``Topping`` having a ``pizzas`` ``ManyToManyField`` ) because its more natural to think about a ``Pizza`` having toppings than a topping being on multiple pizzas. The way its set up in the example, the ``Pizza`` admin form would let users select the toppings.
翻译:
如果你是用管理界面的话, ``ManyToManyField`` 实例应该放到要在管理界面编辑的对象里。在前面的例子里,是 ``toppings`` 位于 ``Pizza`` 中的(而不是 ``Topping`` 中有一个名为 ``pizzas`` 的 ``ManyToManyField`` ),因为这样比一种配料放到多个披萨中更符合人们的思维习惯。在这个例子中,用户可以在 ``Pizza`` 的管理界面中选择配料。
备注:
译者: