summaryrefslogtreecommitdiff
path: root/docs/topics/db
diff options
context:
space:
mode:
authorKarl Hobley <karlhobley10@gmail.com>2015-03-16 19:28:53 +0000
committerTim Graham <timograham@gmail.com>2015-03-18 19:00:09 -0400
commit81e1a35c364e5353d2bf99368ad30a4184fbb653 (patch)
tree2cbfcc6a605600d4f4c387d4c49d17dfe300b91f /docs/topics/db
parent02d78bb1a80706d941ffc6c892cc75208eb6b782 (diff)
Fixed #24495 -- Allowed unsaved model instance assignment check to be bypassed.
Diffstat (limited to 'docs/topics/db')
-rw-r--r--docs/topics/db/examples/many_to_one.txt4
-rw-r--r--docs/topics/db/examples/one_to_one.txt4
2 files changed, 8 insertions, 0 deletions
diff --git a/docs/topics/db/examples/many_to_one.txt b/docs/topics/db/examples/many_to_one.txt
index c5c3e10034..e43809fd1c 100644
--- a/docs/topics/db/examples/many_to_one.txt
+++ b/docs/topics/db/examples/many_to_one.txt
@@ -60,6 +60,10 @@ raises ``ValueError``::
...
ValueError: 'Cannot assign "<Reporter: John Smith>": "Reporter" instance isn't saved in the database.'
+If you want to disable the unsaved instance check, you can use the
+:attr:`~django.db.models.ForeignKey.allow_unsaved_instance_assignment`
+attribute.
+
.. versionchanged:: 1.8
Previously, assigning unsaved objects did not raise an error and could
diff --git a/docs/topics/db/examples/one_to_one.txt b/docs/topics/db/examples/one_to_one.txt
index f1bdf3de9c..f2a3f54508 100644
--- a/docs/topics/db/examples/one_to_one.txt
+++ b/docs/topics/db/examples/one_to_one.txt
@@ -101,6 +101,10 @@ raises ``ValueError``::
...
ValueError: 'Cannot assign "<Restaurant: Demon Dogs the restaurant>": "Restaurant" instance isn't saved in the database.'
+If you want to disable the unsaved instance check, you can use the
+:attr:`~django.db.models.ForeignKey.allow_unsaved_instance_assignment`
+attribute.
+
.. versionchanged:: 1.8
Previously, assigning unsaved objects did not raise an error and could