Opened 3 years ago

Closed 3 years ago

Last modified 3 years 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 by Tim Graham, 3 years ago

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 by Abhyudai, 3 years ago

Owner: changed from nobody to Abhyudai
Status: newassigned

in reply to:  1 comment:3 by Abhyudai, 3 years ago

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 by Abhyudai, 3 years ago

Has patch: set

comment:5 by Mariusz Felisiak, 3 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by GitHub <noreply@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In 019424e4:

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

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

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