Made correction to documentation change from [11045].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11054 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
755762e5b9
commit
b836ed4666
|
@ -946,15 +946,13 @@ in the :ref:`related objects reference <ref-models-relations>`.
|
||||||
|
|
||||||
To assign the members of a related set in one fell swoop, just assign to it
|
To assign the members of a related set in one fell swoop, just assign to it
|
||||||
from any iterable object. The iterable can contain object instances, or just
|
from any iterable object. The iterable can contain object instances, or just
|
||||||
a list of primary key values. For Example::
|
a list of primary key values. For example::
|
||||||
|
|
||||||
Example::
|
|
||||||
|
|
||||||
b = Blog.objects.get(id=1)
|
b = Blog.objects.get(id=1)
|
||||||
b.entry_set = [e1, e2]
|
b.entry_set = [e1, e2]
|
||||||
|
|
||||||
In this example, ``e1`` and ``e2`` can be full Entry instances, or integer
|
In this example, ``e1`` and ``e2`` can be full Entry instances, or integer
|
||||||
values representing primary keys.
|
primary key values.
|
||||||
|
|
||||||
If the ``clear()`` method is available, any pre-existing objects will be
|
If the ``clear()`` method is available, any pre-existing objects will be
|
||||||
removed from the ``entry_set`` before all objects in the iterable (in this
|
removed from the ``entry_set`` before all objects in the iterable (in this
|
||||||
|
|
Loading…
Reference in New Issue