ManyToManyField examples are confused about how many Publication objects there are
— at Version 3
In https://docs.djangoproject.com/en/2.0/topics/db/examples/many_to_many/ , the text says there are two Publication objects ("a couple" and "both"), but the code example creates three, and uses three.
Create a couple of Publications:
>>> p1 = Publication(title='The Python Journal')
>>> p1.save()
>>> p2 = Publication(title='Science News')
>>> p2.save()
>>> p3 = Publication(title='Science Weekly')
>>> p3.save()
[...]
Create another Article, and set it to appear in both Publications:
>>> a2 = Article(headline='NASA uses Python')
>>> a2.save()
>>> a2.publications.add(p1, p2)
>>> a2.publications.add(p3)
Change History
(3)
Resolution: |
→ fixed
|
Status: |
new → closed
|
Description: |
modified (diff)
|
In cef8f6a6: