diff options
Diffstat (limited to 'docs/topics')
| -rw-r--r-- | docs/topics/db/examples/many_to_one.txt | 4 | ||||
| -rw-r--r-- | docs/topics/db/examples/one_to_one.txt | 4 |
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 |
