Opened 13 months ago

Closed 7 weeks ago

Last modified 7 weeks ago

#35680 closed New feature (fixed)

Add default automatic imports to shell

Reported by: Salvo Polizzi Owned by: Salvo Polizzi
Component: Core (Management commands) Version: dev
Severity: Normal Keywords:
Cc: Salvo Polizzi, Ülgen Sarıkavak 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

It could be useful for the final shell's user to have some default imports to avoid extra work of customizing to the user. Following this discussion https://forum.djangoproject.com/t/default-automatic-imports-in-the-shell/33708 , it appears that the most used objects are:

  • Utilities for date and timezone, namely datetime and django.utils.timezone modules
  • Utilites for making or debugging database queries, namely django.db.models and django.db.models.functionsmodules
  • Settings of your projects, namely django.conf.settings

Change History (18)

comment:1 by Natalia Bidart, 13 months ago

Triage Stage: UnreviewedAccepted
Type: Cleanup/optimizationNew feature

Accepting following positive forum discussion. Thank you Salvo for raising this ticket, and working on it!

comment:2 by Salvo Polizzi, 12 months ago

Has patch: set

comment:3 by Sarah Boyce, 12 months ago

Needs documentation: set
Patch needs improvement: set

comment:4 by Ülgen Sarıkavak, 10 months ago

Cc: Ülgen Sarıkavak added

comment:5 by Salvo Polizzi, 7 months ago

Needs documentation: unset
Patch needs improvement: unset

comment:6 by Sarah Boyce, 7 months ago

Needs documentation: set

comment:7 by Jacob Walls, 7 months ago

Needs documentation: unset

comment:8 by Sarah Boyce, 6 months ago

Patch needs improvement: set

comment:9 by Salvo Polizzi, 6 months ago

Patch needs improvement: unset

comment:10 by Sarah Boyce, 6 months ago

Patch needs improvement: set

comment:11 by Jacob Walls, 3 months ago

Patch needs improvement: unset

comment:12 by Sarah Boyce, 3 months ago

Patch needs improvement: set

comment:13 by Salvo Polizzi, 3 months ago

Patch needs improvement: unset

comment:14 by Sarah Boyce, 2 months ago

Patch needs improvement: set

comment:15 by Salvo Polizzi, 2 months ago

Patch needs improvement: unset

comment:16 by Sarah Boyce, 7 weeks ago

Triage Stage: AcceptedReady for checkin

comment:17 by Sarah Boyce <42296566+sarahboyce@…>, 7 weeks ago

Resolution: fixed
Status: assignedclosed

In a5cd84a:

Fixed #35680 -- Added automatic imports of common utilies to shell management command.

comment:18 by GitHub <noreply@…>, 7 weeks ago

In e767bd6:

Refs #35680 -- Sorted shell default autoimports to prevent isort mismatches.

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