Skip to content
Browse files

Fixed #20183 - Clarified docs assumption that certain objects exist i…

…n database.

Thanks Tomasz Jaskowski for the patch.
  • Loading branch information...
1 parent a4ab0e8 commit 41bea033b7e6b9d28c99f8c1ddedecad13009bd0 @timgraham timgraham committed
Showing with 2 additions and 1 deletion.
  1. +2 −1 docs/topics/db/queries.txt
View
3 docs/topics/db/queries.txt
@@ -102,7 +102,8 @@ Saving ``ForeignKey`` and ``ManyToManyField`` fields
Updating a :class:`~django.db.models.ForeignKey` field works exactly the same
way as saving a normal field -- simply assign an object of the right type to
the field in question. This example updates the ``blog`` attribute of an
-``Entry`` instance ``entry``::
+``Entry`` instance ``entry``, assuming appropriate instances of ``Entry`` and
+``Blog`` are already saved to the database (so we can retrieve them below)::
>>> from blog.models import Entry
>>> entry = Entry.objects.get(pk=1)

0 comments on commit 41bea03

Please sign in to comment.
Something went wrong with that request. Please try again.