mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
[2.1.x] Fixed IntegrityError in docs/topics/db/examples/many_to_one.txt.
Backport of 6b6bdfe25c946ee9512b3866d64930fe1be619fd from master
This commit is contained in:
parent
e9950ed897
commit
3153cb319d
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user