Opened 11 hours ago

Closed 8 hours ago

Last modified 8 hours ago

#36159 closed Cleanup/optimization (fixed)

Remove the example of the empty import shell customization

Reported by: Salvo Polizzi Owned by: Salvo Polizzi
Component: Documentation Version: 5.2
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Salvo Polizzi)

The final section of this 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.

Change History (7)

comment:1 by Salvo Polizzi, 11 hours ago

Version: 5.1dev

comment:2 by Sarah Boyce, 10 hours ago

Summary: Update the shell customization tutorial to reflect the --no-imports flag.Remove the example of the empty import shell customization
Triage Stage: UnreviewedAccepted
Version: dev5.2

I think you mean 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 👍

comment:3 by Salvo Polizzi, 10 hours ago

Description: modified (diff)

in reply to:  2 comment:4 by Salvo Polizzi, 10 hours ago

Replying to Sarah Boyce:

I think you mean 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

comment:5 by Sarah Boyce, 9 hours ago

Has patch: set
Triage Stage: AcceptedReady for checkin

comment:6 by Sarah Boyce <42296566+sarahboyce@…>, 8 hours ago

Resolution: fixed
Status: assignedclosed

In b84478a:

Fixed #36159 -- Removed the empty import example in the custom shell docs.

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

comment:7 by Sarah Boyce <42296566+sarahboyce@…>, 8 hours ago

In dfaf8aa:

[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.

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