mirror of
https://github.com/django/django.git
synced 2025-11-01 04:17:59 +00:00
Fixed #6707 -- Added RelatedManager.set() and made descriptors' __set__ use it.
Thanks Anssi Kääriäinen, Carl Meyer, Collin Anderson, and Tim Graham for the reviews.
This commit is contained in:
parent
49516f7158
commit
71ada3a8e6
10 changed files with 350 additions and 100 deletions
|
|
@ -1190,6 +1190,9 @@ be found in the :doc:`related objects reference </ref/models/relations>`.
|
|||
``clear()``
|
||||
Removes all objects from the related object set.
|
||||
|
||||
``set(objs)``
|
||||
Replace the set of related objects.
|
||||
|
||||
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
|
||||
a list of primary key values. For example::
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue