[Django] #32950: Documentation errors in ModelAdmin objects (/ref/contrib/admin)?

15 views
Skip to first unread message

Django

unread,
Jul 20, 2021, 9:18:58 AM7/20/21
to django-...@googlegroups.com
#32950: Documentation errors in ModelAdmin objects (/ref/contrib/admin)?
-----------------------------------------+----------------------------
Reporter: Ken Whitesell | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 3.2
Severity: Normal | Keywords: ModelAdmin
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-----------------------------------------+----------------------------
The first example in the section for
[https://docs.djangoproject.com/en/3.2/ref/contrib/admin/#django.contrib.admin.ModelAdmin
class ModelAdmin] has the following line:

{{{
#!python
from myproject.myapp.models import Author
}}}
(There are multiple occurrences of this on this page.)
Is it proper to specify the "myproject" path component here?

It looks to me like this would only be valid if the manage.py file were
located "above" the myproject directory, which is different from where the
startproject command places it.

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

Django

unread,
Jul 20, 2021, 9:28:53 AM7/20/21
to django-...@googlegroups.com
#32950: Remove "myproject" from imports in docs
-------------------------------+------------------------------------

Reporter: Ken Whitesell | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 3.2
Severity: Normal | Resolution:
Keywords: ModelAdmin | Triage Stage: Accepted

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

* stage: Unreviewed => Accepted


Comment:

Yes, I think that should be adjusted. A complete audit:
{{{
docs/ref/contrib/syndication.txt: from myproject.feeds import
LatestEntriesFeed
docs/ref/contrib/syndication.txt: from myproject.feeds import
AtomSiteNewsFeed, RssSiteNewsFeed
docs/ref/contrib/admin/index.txt: from myproject.myapp.models
import Author
docs/ref/contrib/admin/index.txt: from myproject.myapp.models
import Author
docs/ref/contrib/admin/index.txt: from myproject.admin_site import
custom_admin_site
docs/ref/contrib/admin/index.txt: from myproject.myapp.models import
Image, Product
docs/ref/contrib/admin/index.txt: from myproject.admin import
advanced_site, basic_site
}}}

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

Django

unread,
Jul 21, 2021, 5:01:44 AM7/21/21
to django-...@googlegroups.com
#32950: Remove "myproject" from imports in docs
-------------------------------+------------------------------------
Reporter: Ken Whitesell | Owner: Abhyudai
Type: Bug | Status: assigned
Component: Documentation | Version: 3.2

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

* owner: nobody => Abhyudai
* status: new => assigned


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

Django

unread,
Jul 21, 2021, 2:47:29 PM7/21/21
to django-...@googlegroups.com
#32950: Remove "myproject" from imports in docs
-------------------------------+------------------------------------
Reporter: Ken Whitesell | Owner: Abhyudai
Type: Bug | Status: assigned
Component: Documentation | Version: 3.2

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

Comment (by Abhyudai):

Replying to [comment:1 Tim Graham]:


> Yes, I think that should be adjusted. A complete audit:
> {{{
> docs/ref/contrib/syndication.txt: from myproject.feeds import
LatestEntriesFeed
> docs/ref/contrib/syndication.txt: from myproject.feeds import
AtomSiteNewsFeed, RssSiteNewsFeed
> }}}

I think these are appropriate, since the documentation here talks about
adding feeds. Changing this to something like `from feeds import
LatestEntriesFeed` could likely be more confusing, in my opinion.
>{{{


> docs/ref/contrib/admin/index.txt: from myproject.admin_site
import custom_admin_site

> docs/ref/contrib/admin/index.txt: from myproject.admin import
advanced_site, basic_site
>}}}
Here, the documentation refers to using custom `admin` site for different
purposes, and these shouldn't necessarily be fit into an `app`. I think it
would be appropriate to keep this in its original form.

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

Django

unread,
Jul 22, 2021, 7:22:36 AM7/22/21
to django-...@googlegroups.com
#32950: Remove "myproject" from imports in docs
-------------------------------+------------------------------------
Reporter: Ken Whitesell | Owner: Abhyudai
Type: Bug | Status: assigned
Component: Documentation | Version: 3.2

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

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

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/14682 pull-request]

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

Django

unread,
Jul 22, 2021, 2:35:17 PM7/22/21
to django-...@googlegroups.com
#32950: Remove "myproject" from imports in docs
-------------------------------------+-------------------------------------

Reporter: Ken Whitesell | Owner: Abhyudai
Type: Bug | Status: assigned
Component: Documentation | Version: 3.2
Severity: Normal | Resolution:
Keywords: ModelAdmin | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

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

* stage: Accepted => Ready for checkin


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

Django

unread,
Jul 23, 2021, 12:19:44 AM7/23/21
to django-...@googlegroups.com
#32950: Remove "myproject" from imports in docs
-------------------------------------+-------------------------------------
Reporter: Ken Whitesell | Owner: Abhyudai
Type: Bug | Status: closed
Component: Documentation | Version: 3.2
Severity: Normal | Resolution: fixed

Keywords: ModelAdmin | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

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


Comment:

In [changeset:"019424e44efe495bc5981eb9848c0bb398a6f068" 019424e4]:
{{{
#!CommitTicketReference repository=""
revision="019424e44efe495bc5981eb9848c0bb398a6f068"
Fixed #32950 -- Removed myproject from imports in admin docs where
appropriate.
}}}

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

Django

unread,
Jul 23, 2021, 12:20:34 AM7/23/21
to django-...@googlegroups.com
#32950: Remove "myproject" from imports in docs
-------------------------------------+-------------------------------------
Reporter: Ken Whitesell | Owner: Abhyudai
Type: Bug | Status: closed
Component: Documentation | Version: 3.2

Severity: Normal | Resolution: fixed
Keywords: ModelAdmin | Triage Stage: Ready for
| checkin
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:"de5a044cf49ba3d856388fe008f1e1a82a69b699" de5a044]:
{{{
#!CommitTicketReference repository=""
revision="de5a044cf49ba3d856388fe008f1e1a82a69b699"
[3.2.x] Fixed #32950 -- Removed myproject from imports in admin docs where
appropriate.

Backport of 019424e44efe495bc5981eb9848c0bb398a6f068 from main
}}}

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

Reply all
Reply to author
Forward
0 new messages