[Django] #32372: Clarification of "RelatedManager" class example

23 views
Skip to first unread message

Django

unread,
Jan 20, 2021, 12:53:57 PM1/20/21
to django-...@googlegroups.com
#32372: Clarification of "RelatedManager" class example
-----------------------------------------+------------------------
Reporter: Jack | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 3.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
I have a suggested clarification in the docs, under the "Related objects
reference" section:
[https://docs.djangoproject.com/en/3.1/ref/models/relations/].

One of the first examples of a ManyToMany field relationship begins with
an example of a Pizza model and a Toppings model, but in the shell example
below it demonstrates this relationship with two different models: a Blog
model and an Entry model.

I've read through this section a few times so I apologize in advance if
I'm incorrect in my understanding, but in my opinion it would be clearer
to stick with one set of classes for both the examples. If choosing to
continue with the Pizza and Toppings example, I would suggest changing the
example shown in the shell as follows:

{{{
>>> t = Topping.objects.get(id=1)
>>> p = Pizza.objects.get(id=5)
>>> t.pizza_set.add(p) # Associates Topping t with Pizza p.
}}}


If this is agreeable, I would love to make this change.

--
Ticket URL: <https://code.djangoproject.com/ticket/32372>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 20, 2021, 12:56:49 PM1/20/21
to django-...@googlegroups.com
#32372: Clarification of "RelatedManager" class example
-------------------------------------+-------------------------------------
Reporter: Jack | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 3.1
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jack):

* type: Uncategorized => Cleanup/optimization


--
Ticket URL: <https://code.djangoproject.com/ticket/32372#comment:1>

Django

unread,
Jan 21, 2021, 12:29:14 AM1/21/21
to django-...@googlegroups.com
#32372: Improve consistency in "Related objects reference" docs.
--------------------------------------+------------------------------------
Reporter: Jack | Owner: Jack
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 3.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* owner: nobody => Jack
* status: new => assigned
* easy: 0 => 1
* stage: Unreviewed => Accepted


Comment:

Examples in this page use reverse relation for a `ForeignKey` not a
`ManyToManyField`, so the be more consistent we could change change the
`Reporter - Article` example to
[https://docs.djangoproject.com/en/3.1/topics/db/queries/#making-queries
Blog - Entry], e.g.:
{{{
class Blog(models.Model):
# ...
pass

class Entry(models.Model):
blog = models.ForeignKey(Entry, on_delete=models.CASCADE)
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32372#comment:2>

Django

unread,
Jan 21, 2021, 2:51:39 PM1/21/21
to django-...@googlegroups.com
#32372: Improve consistency in "Related objects reference" docs.
--------------------------------------+------------------------------------
Reporter: Jack | Owner: Jack
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 3.1

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Jack):

Replying to [comment:2 Mariusz Felisiak]:

Apologies, this is my first contribution so I'm still learning a lot. I've
followed the [https://docs.djangoproject.com/en/3.1/internals/contributing
/new-contributors/ Advice for new contributors] as well as
[https://docs.djangoproject.com/en/3.1/internals/contributing/writing-
documentation/ Writing documentation]. I've now built the html files using
Sphinx but when I try to git add relations.html from
/docs/_build/html/ref/models I get an error:
{{{
The following paths are ignored by one of your .gitignore files:
docs/_build/html/ref/models/relations.html
}}}

Sorry! Any help you can give would be really appreciated.

--
Ticket URL: <https://code.djangoproject.com/ticket/32372#comment:3>

Django

unread,
Jan 21, 2021, 5:13:20 PM1/21/21
to django-...@googlegroups.com
#32372: Improve consistency in "Related objects reference" docs.
-------------------------------------+-------------------------------------
Reporter: Jack Aitken | Owner: Jack
Type: | Aitken
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 3.1

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

Only the source files for the docs are stored in version control. You can
build the docs locally for testing, but you shouldn't put anything from
`docs/_build` in your commit.

--
Ticket URL: <https://code.djangoproject.com/ticket/32372#comment:4>

Django

unread,
Jan 21, 2021, 9:13:11 PM1/21/21
to django-...@googlegroups.com
#32372: Improve consistency in "Related objects reference" docs.
-------------------------------------+-------------------------------------
Reporter: Jack Aitken | Owner: Jack
Type: | Aitken
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 3.1

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jack Aitken):

* has_patch: 0 => 1


Comment:

Thanks, Tim!

PR was made here is the link: [https://github.com/django/django/pull/13926
PR #13926]

--
Ticket URL: <https://code.djangoproject.com/ticket/32372#comment:5>

Django

unread,
Jan 22, 2021, 12:53:49 AM1/22/21
to django-...@googlegroups.com
#32372: Improve consistency in "Related objects reference" docs.
-------------------------------------+-------------------------------------
Reporter: Jack Aitken | Owner: Jack
Type: | Aitken
Cleanup/optimization | Status: closed
Component: Documentation | Version: 3.1
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"725c549ae7a34d83447201da7190f8d71c7fc2fc" 725c549]:
{{{
#!CommitTicketReference repository=""
revision="725c549ae7a34d83447201da7190f8d71c7fc2fc"
Fixed #32372 -- Made examples in related objects reference docs
consistent.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32372#comment:7>

Django

unread,
Jan 22, 2021, 12:53:49 AM1/22/21
to django-...@googlegroups.com
#32372: Improve consistency in "Related objects reference" docs.
-------------------------------------+-------------------------------------
Reporter: Jack Aitken | Owner: Jack
Type: | Aitken
Cleanup/optimization | Status: closed
Component: Documentation | Version: 3.1

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"59c63c7f6b79ea9773aff34c53df3306e801800f" 59c63c7f]:
{{{
#!CommitTicketReference repository=""
revision="59c63c7f6b79ea9773aff34c53df3306e801800f"
[3.2.x] Fixed #32372 -- Made examples in related objects reference docs
consistent.

Backport of 725c549ae7a34d83447201da7190f8d71c7fc2fc from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32372#comment:6>

Django

unread,
Jan 22, 2021, 12:54:02 AM1/22/21
to django-...@googlegroups.com
#32372: Improve consistency in "Related objects reference" docs.
-------------------------------------+-------------------------------------
Reporter: Jack Aitken | Owner: Jack
Type: | Aitken
Cleanup/optimization | Status: closed
Component: Documentation | Version: 3.1

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"cc5ee23f74b765f35b4ba05a122eef576cedbb3b" cc5ee23f]:
{{{
#!CommitTicketReference repository=""
revision="cc5ee23f74b765f35b4ba05a122eef576cedbb3b"
[3.1.x] Fixed #32372 -- Made examples in related objects reference docs
consistent.

Backport of 725c549ae7a34d83447201da7190f8d71c7fc2fc from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32372#comment:8>

Django

unread,
Jan 22, 2021, 2:19:34 PM1/22/21
to django-...@googlegroups.com
#32372: Improve consistency in "Related objects reference" docs.
-------------------------------------+-------------------------------------
Reporter: Jack Aitken | Owner: Jack
Type: | Aitken
Cleanup/optimization | Status: closed
Component: Documentation | Version: 3.1

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"2b4b6c8af0aae8785bc1347cf1be2e8e70fd5ff3" 2b4b6c8a]:
{{{
#!CommitTicketReference repository=""
revision="2b4b6c8af0aae8785bc1347cf1be2e8e70fd5ff3"
Refs #32372 -- Updated manager name in related objects reference docs.

Follow up to 725c549ae7a34d83447201da7190f8d71c7fc2fc.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32372#comment:9>

Django

unread,
Jan 22, 2021, 2:20:04 PM1/22/21
to django-...@googlegroups.com
#32372: Improve consistency in "Related objects reference" docs.
-------------------------------------+-------------------------------------
Reporter: Jack Aitken | Owner: Jack
Type: | Aitken
Cleanup/optimization | Status: closed
Component: Documentation | Version: 3.1

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"c708837a693f0554648b0442827a1e9f3ce67d3f" c708837a]:
{{{
#!CommitTicketReference repository=""
revision="c708837a693f0554648b0442827a1e9f3ce67d3f"
[3.2.x] Refs #32372 -- Updated manager name in related objects reference
docs.

Follow up to 725c549ae7a34d83447201da7190f8d71c7fc2fc.
Backport of 2b4b6c8af0aae8785bc1347cf1be2e8e70fd5ff3 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32372#comment:10>

Django

unread,
Jan 22, 2021, 2:20:33 PM1/22/21
to django-...@googlegroups.com
#32372: Improve consistency in "Related objects reference" docs.
-------------------------------------+-------------------------------------
Reporter: Jack Aitken | Owner: Jack
Type: | Aitken
Cleanup/optimization | Status: closed
Component: Documentation | Version: 3.1

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"18adc89e50dca63b664a721ea9790279524b6db3" 18adc89e]:
{{{
#!CommitTicketReference repository=""
revision="18adc89e50dca63b664a721ea9790279524b6db3"
[3.1.x] Refs #32372 -- Updated manager name in related objects reference
docs.

Follow up to 725c549ae7a34d83447201da7190f8d71c7fc2fc.
Backport of 2b4b6c8af0aae8785bc1347cf1be2e8e70fd5ff3 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32372#comment:11>

Reply all
Reply to author
Forward
0 new messages