summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-02-24 11:50:21 -0500
committerTim Graham <timograham@gmail.com>2015-02-24 11:51:10 -0500
commit81911f29b70710d8f72916c49a69aa5df5cd7df8 (patch)
treee0eb2f37cd7283bf562a4d02a7980452d0f7581a /docs
parenta3fca05b05551fdd7089e7be49d48c454ea50a84 (diff)
[1.8.x] Reverted "Fixed #24325 -- Documented change in ModelForm.save() foreign key access."
This reverts commit 0af3822dc362b6253bda1c9699466dd0bbbf6066. It's obsoleted by refs #24395. Backport of d298b1ba5043eaa40f3f4bebe3c7634b359ba34b from master
Diffstat (limited to 'docs')
-rw-r--r--docs/releases/1.8.txt22
-rw-r--r--docs/spelling_wordlist1
2 files changed, 0 insertions, 23 deletions
diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt
index 7996a5c01c..a88b406a32 100644
--- a/docs/releases/1.8.txt
+++ b/docs/releases/1.8.txt
@@ -712,28 +712,6 @@ Now, an error will be raised to prevent data loss::
...
ValueError: Cannot assign "<Author: John>": "Author" instance isn't saved in the database.
-Accessing foreign keys in ``ModelForm.save()``
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-In older versions, you could access unsaved foreign key objects in
-``ModelForm.save()`` when adding new objects. For example, given ``Book`` with
-a ``ForeignKey`` to ``Author``::
-
- class BookForm(forms.ModelForm):
- def save(self, *args, **kwargs):
- book = super(BookForm, self).save(*args, **kwargs)
- book.title = "%s by %s" % (book.title, book.author.name)
- return book
-
-Now if the related instance hasn't been saved (for example, when adding an
-author and some inlined books in the admin), accessing the foreign key
-``book.author`` in the example) will raise ``RelatedObjectDoesNotExist``. This
-change was necessary to avoid assigning unsaved objects to relations (as
-described in the previous section).
-
-To adapt the example above, you could replace ``book.author.name`` with
-``self.cleaned_data['author'].name``.
-
Management commands that only accept positional arguments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/docs/spelling_wordlist b/docs/spelling_wordlist
index 157d998407..807ef884a0 100644
--- a/docs/spelling_wordlist
+++ b/docs/spelling_wordlist
@@ -296,7 +296,6 @@ ing
ini
init
inline
-inlined
inlines
inspectdb
Instagram