Skip to content

Commit 6b6bdfe

Browse files
committed
Fixed IntegrityError in docs/topics/db/examples/many_to_one.txt.
1 parent 1ed8527 commit 6b6bdfe

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/topics/db/examples/many_to_one.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,9 @@ Create an Article via the Reporter object::
7474
>>> new_article.reporter.id
7575
1
7676

77-
Create a new article, and add it to the article set::
77+
Create a new article::
7878

79-
>>> new_article2 = Article.objects.create(headline="Paul's story", pub_date=date(2006, 1, 17))
80-
>>> r.article_set.add(new_article2)
79+
>>> new_article2 = Article.objects.create(headline="Paul's story", pub_date=date(2006, 1, 17), reporter=r)
8180
>>> new_article2.reporter
8281
<Reporter: John Smith>
8382
>>> new_article2.reporter.id

0 commit comments

Comments
 (0)