Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#29591 closed Bug (fixed)

ManyToManyField examples are confused about how many Publication objects there are

Reported by: Marnanel Thurman Owned by: nobody
Component: Documentation Version: 2.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

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)

comment:1 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: newclosed

In cef8f6a6:

Fixed #29591 -- Fixed numbering words in docs/topics/db/examples/many_to_many.txt.

comment:2 by Tim Graham <timograham@…>, 6 years ago

In 9cd6f9c1:

[2.1.x] Fixed #29591 -- Fixed numbering words in docs/topics/db/examples/many_to_many.txt.

Backport of cef8f6a61bc8079fa36cb37a7d411b56869ffe32 from master

comment:3 by Tim Graham, 6 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top