Opened 11 months ago

Closed 11 months ago

Last modified 11 months ago

#32950 closed Bug (fixed)

Remove "myproject" from imports in docs

Reported by: Ken Whitesell Owned by: Abhyudai
Component: Documentation Version: 3.2
Severity: Normal Keywords: ModelAdmin
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

The first example in the section for class ModelAdmin has the following line:

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.

Change History (7)

comment:1 Changed 11 months ago by Tim Graham

Summary: Documentation errors in ModelAdmin objects (/ref/contrib/admin)?Remove "myproject" from imports in docs
Triage Stage: UnreviewedAccepted

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

comment:2 Changed 11 months ago by Abhyudai

Owner: changed from nobody to Abhyudai
Status: newassigned

comment:3 in reply to:  1 Changed 11 months ago by Abhyudai

Replying to 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.

comment:4 Changed 11 months ago by Abhyudai

Has patch: set

comment:5 Changed 11 months ago by Mariusz Felisiak

Triage Stage: AcceptedReady for checkin

comment:6 Changed 11 months ago by GitHub <noreply@…>

Resolution: fixed
Status: assignedclosed

In 019424e4:

Fixed #32950 -- Removed myproject from imports in admin docs where appropriate.

comment:7 Changed 11 months ago by Mariusz Felisiak <felisiak.mariusz@…>

In de5a044:

[3.2.x] Fixed #32950 -- Removed myproject from imports in admin docs where appropriate.

Backport of 019424e44efe495bc5981eb9848c0bb398a6f068 from main

Note: See TracTickets for help on using tickets.
Back to Top