diff options
| author | Tim Graham <timograham@gmail.com> | 2015-10-08 17:17:10 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-10-27 07:57:15 -0400 |
| commit | 9c5e272860c076736237d4b280c7c922c46ba273 (patch) | |
| tree | 69727482a17b9bf2594c0755ee9f00f5f361cea0 /docs/ref | |
| parent | 0b5d32facaa1badc0553934f6935507070cfea1b (diff) | |
Fixed #25550 -- Deprecated direct assignment to the reverse side of a related set.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/contrib/auth.txt | 2 | ||||
| -rw-r--r-- | docs/ref/models/relations.txt | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/docs/ref/contrib/auth.txt b/docs/ref/contrib/auth.txt index 217bd432b5..6cbfd88ac6 100644 --- a/docs/ref/contrib/auth.txt +++ b/docs/ref/contrib/auth.txt @@ -337,7 +337,7 @@ Fields Many-to-many field to :class:`~django.contrib.auth.models.Permission`:: - group.permissions = [permission_list] + group.permissions.set([permission_list]) group.permissions.add(permission, permission, ...) group.permissions.remove(permission, permission, ...) group.permissions.clear() diff --git a/docs/ref/models/relations.txt b/docs/ref/models/relations.txt index e89355679a..8671d83d51 100644 --- a/docs/ref/models/relations.txt +++ b/docs/ref/models/relations.txt @@ -179,8 +179,6 @@ Related objects reference <intermediary-manytomany>` for a many-to-many relationship, some of the related manager's methods are disabled. -.. _direct-assignment: - Direct Assignment ----------------- @@ -200,3 +198,12 @@ added to the existing related object set. In earlier versions, direct assignment used to perform ``clear()`` followed by ``add()``. It now performs a ``set()`` with the keyword argument ``clear=False``. + +.. deprecated:: 1.10 + + Direct assignment is deprecated in favor of the + :meth:`~django.db.models.fields.related.RelatedManager.set` method:: + + >>> e.related_set.set([obj1, obj2, obj3]) + + This prevents confusion about an assignment resulting in an implicit save. |
