summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2018-07-19 15:47:20 -0400
committerTim Graham <timograham@gmail.com>2018-07-19 15:49:54 -0400
commit3153cb319d0ba4f14662634a928b272d689455c0 (patch)
tree07244abe427edb8b925081b7543624626a71ad2e /docs
parente9950ed897fba3a98dd1221ad9e9b610bb5bc0c1 (diff)
[2.1.x] Fixed IntegrityError in docs/topics/db/examples/many_to_one.txt.
Backport of 6b6bdfe25c946ee9512b3866d64930fe1be619fd from master
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/db/examples/many_to_one.txt5
1 files changed, 2 insertions, 3 deletions
diff --git a/docs/topics/db/examples/many_to_one.txt b/docs/topics/db/examples/many_to_one.txt
index 4ff80e07a9..8a77d89d6d 100644
--- a/docs/topics/db/examples/many_to_one.txt
+++ b/docs/topics/db/examples/many_to_one.txt
@@ -74,10 +74,9 @@ Create an Article via the Reporter object::
>>> new_article.reporter.id
1
-Create a new article, and add it to the article set::
+Create a new article::
- >>> new_article2 = Article.objects.create(headline="Paul's story", pub_date=date(2006, 1, 17))
- >>> r.article_set.add(new_article2)
+ >>> new_article2 = Article.objects.create(headline="Paul's story", pub_date=date(2006, 1, 17), reporter=r)
>>> new_article2.reporter
<Reporter: John Smith>
>>> new_article2.reporter.id