Django Book 翻译
菜单>:
TOC
返回
原文:
In order to prevent database inconsistency, this method only exists on ``ForeignKey`` objects where ``null=True`` . If the related field cant be set to ``None`` (``NULL`` ), then an object cant be removed from a relation without being added to another. In the preceding example, removing ``e`` from ``b.entry_set()`` is equivalent to doing ``e.blog = None`` , and because the ``blog`` ``ForeignKey`` doesnt have ``null=True`` , this is invalid.
翻译:
为了阻止数据库的不稳定,这种方法只能对含有外键字段并且该字段可以为null的对象有效,如果关联字段不能设置为"None"("NULL"),then an object can't be removed from a relation without being added to another. 在之前的例子中,从``b.entry_set()`` 中删除e,相当于"e.blog=None",因为这个"blog""ForeignKey"不能"nullTrue",所以这是无效的删除.
备注:
译者: