Re: [Django] #36159: Remove the example of the empty import shell customization

9 views
Skip to first unread message

Django

unread,
Jan 30, 2025, 4:34:46 AM1/30/25
to django-...@googlegroups.com
#36159: Remove the example of the empty import shell customization
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
Type: | Polizzi
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Salvo Polizzi:

Old description:

> The final section of this [https://docs.djangoproject.com/en/dev/ref
> /django-admin/#django-admin-shell tutorial] currently states:
>
> ''If you prefer to not have models automatically imported, create a
> custom get_namespace() that excludes the super().get_namespace() call:''
> {{{
> from django.core.management.commands import shell
>
> class Command(shell.Command):
> def get_namespace(self):
> return {}
> }}}
>
> ----
>
> This section can be replaced with a simpler explanation:
>
> ''To disable automatic importing entirely, use the --no-imports flag.''

New description:

The final section of this [https://docs.djangoproject.com/en/dev/howto
/custom-shell/#customize-automatic-imports tutorial] currently states:

''If you prefer to not have models automatically imported, create a custom
get_namespace() that excludes the super().get_namespace() call:''
{{{
from django.core.management.commands import shell

class Command(shell.Command):
def get_namespace(self):
return {}
}}}

----

This section can be replaced with a simpler explanation:

''To disable automatic importing entirely, use the --no-imports flag.''

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

Django

unread,
Jan 30, 2025, 4:35:38 AM1/30/25
to django-...@googlegroups.com
#36159: Remove the example of the empty import shell customization
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
Type: | Polizzi
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Salvo Polizzi):

Replying to [comment:2 Sarah Boyce]:
> I think you mean [https://docs.djangoproject.com/en/dev/howto/custom-
shell/#customizing-shell-auto-imports this section] and I think it makes
sense to remove the part "If you prefer to not have models
automatically..." and example entirely as the `--no-imports` flag is
already documented 👍

Yes, sorry😅. I modified the description
--
Ticket URL: <https://code.djangoproject.com/ticket/36159#comment:4>

Django

unread,
Jan 30, 2025, 5:04:34 AM1/30/25
to django-...@googlegroups.com
#36159: Remove the example of the empty import shell customization
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
Type: | Polizzi
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* has_patch: 0 => 1
* stage: Accepted => Ready for checkin

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

Django

unread,
Jan 30, 2025, 6:15:17 AM1/30/25
to django-...@googlegroups.com
#36159: Remove the example of the empty import shell customization
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
Type: | Polizzi
Cleanup/optimization | Status: closed
Component: Documentation | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

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

Comment:

In [changeset:"b84478ae953d049a1da42c3d0ef3ab3a9467b649" b84478a]:
{{{#!CommitTicketReference repository=""
revision="b84478ae953d049a1da42c3d0ef3ab3a9467b649"
Fixed #36159 -- Removed the empty import example in the custom shell docs.

This can be achieved with the --no-imports flag.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36159#comment:6>

Django

unread,
Jan 30, 2025, 6:16:55 AM1/30/25
to django-...@googlegroups.com
#36159: Remove the example of the empty import shell customization
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
Type: | Polizzi
Cleanup/optimization | Status: closed
Component: Documentation | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"dfaf8aa6c627df1357947d69a6c1073707e62523" dfaf8aa]:
{{{#!CommitTicketReference repository=""
revision="dfaf8aa6c627df1357947d69a6c1073707e62523"
[5.2.x] Fixed #36159 -- Removed the empty import example in the custom
shell docs.

This can be achieved with the --no-imports flag.

Backport of b84478ae953d049a1da42c3d0ef3ab3a9467b649 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36159#comment:7>
Reply all
Reply to author
Forward
0 new messages