mirror of https://github.com/django/django.git
[1.11.x] Added missing import in docs/topics/db/queries.txt.
Backport of 14251324e6
from master
This commit is contained in:
parent
eabd967726
commit
664f5708c8
|
@ -101,7 +101,7 @@ the field in question. This example updates the ``blog`` attribute of an
|
||||||
``Entry`` instance ``entry``, assuming appropriate instances of ``Entry`` and
|
``Entry`` instance ``entry``, assuming appropriate instances of ``Entry`` and
|
||||||
``Blog`` are already saved to the database (so we can retrieve them below)::
|
``Blog`` are already saved to the database (so we can retrieve them below)::
|
||||||
|
|
||||||
>>> from blog.models import Entry
|
>>> from blog.models import Blog, Entry
|
||||||
>>> entry = Entry.objects.get(pk=1)
|
>>> entry = Entry.objects.get(pk=1)
|
||||||
>>> cheese_blog = Blog.objects.get(name="Cheddar Talk")
|
>>> cheese_blog = Blog.objects.get(name="Cheddar Talk")
|
||||||
>>> entry.blog = cheese_blog
|
>>> entry.blog = cheese_blog
|
||||||
|
|
Loading…
Reference in New Issue