Opened 7 years ago

Closed 5 years ago

Last modified 5 years ago

#11745 closed Cleanup/optimization (fixed)

Categories by origin for command listings in "manage.py help"

Reported by: Vlada Macek Owned by: Aymeric Augustin
Component: Core (Management commands) Version: master
Severity: Normal Keywords: help color django-admin manage.py
Cc: t.django@…, sebastien.fievet@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As the number of loaded modules and apps grows for bigger project, simple alphabetic list of "manage.py help" commands becomes a pell-mell.

Very quickly I learn from which Python module the command I search is originating from. This applies the most for my own commands, even the most frequent situation is that I need to find my own mgmt command name for copy'n'paste.

The attached patch displays the help list with colored categories like this:

Available subcommands:

[myapp]
  dump_all_objects
  import_images
  invalidate_memcached

[django]
  cleanup
  compilemessages
  createcachetable
  createsuperuser
  dbshell
  ...

[django_evolution]
  evolve

[django_extensions]
  clean_pyc
  compile_pyc
  create_app
  create_command
  create_jobs
  ...

Attachments (2)

help-categories-with-colors.patch (1.5 KB) - added by Vlada Macek 7 years ago.
Categorizes the commands in the "manage.py help" list
11745-2.patch (8.2 KB) - added by Aymeric Augustin 5 years ago.

Download all attachments as: .zip

Change History (20)

Changed 7 years ago by Vlada Macek

Categorizes the commands in the "manage.py help" list

comment:1 Changed 7 years ago by anonymous

Cc: t.django@… added; tuttle@… removed
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:2 Changed 7 years ago by Thejaswi Puthraya

Component: UncategorizedCore framework

comment:3 Changed 7 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

comment:4 Changed 5 years ago by Julien Phalip

Severity: Normal
Type: Cleanup/optimization

comment:5 Changed 5 years ago by Graham King

Easy pickings: unset
Keywords: help color django-admin manage.py added
milestone: 1.4

Applies cleanly to trunk. All the tests pass. I love this. It would be very useful on my current work project.

I've tested it on three different projects, a very simple one with only the 'django' module, a two-module one (django and south), and a very complex one (76 management commands in 11 modules). Works perfectly. Strong +1 from me.

Could someone try it on Windows and Mac, just to be 100%? If it works OK on those (it's using color_style, so it should) then it's Ready For Checkin.

comment:6 Changed 5 years ago by Martin Mahner

This works fine on a Mac however I see two problems with it:

  1. Its backwards incompatible, I am not sure if its a huge deal but someone could parse this list, having an option 'manage.py help --list' to get the old behavior would be fine.
  2. It's irritating, if an app overwrites a 'core' app, this command is under that app. See the South help list:
[south]
  convert_to_south
  datamigration
  graphmigrations
  migrate
  schemamigration
  startmigration
  syncdb
  test
  testserver

South overwrites 'test' and 'testserver' which I would expect under [django].

Last edited 5 years ago by Martin Mahner (previous) (diff)

comment:7 Changed 5 years ago by Jannis Leidel

FWIW, I agree with bartTC's points, except that 'manage.py help --commands' seems more fitting.

comment:8 Changed 5 years ago by Jannis Leidel

Patch needs improvement: set

comment:9 Changed 5 years ago by Jannis Leidel

Component: Core (Other)Core (Management commands)

comment:10 Changed 5 years ago by sebastien.fievet@…

Cc: sebastien.fievet@… added
UI/UX: unset

comment:11 Changed 5 years ago by Aymeric Augustin

#16445 was a duplicate.

comment:12 Changed 5 years ago by Jacob

milestone: 1.4

Milestone 1.4 deleted

comment:13 Changed 5 years ago by Aymeric Augustin

Patch needs improvement: unset

I'm uploading a new patch with the implementation discussed on IRC with jezdez, tests and docs.

comment:14 Changed 5 years ago by Aymeric Augustin

I've also made the implementation of version / --version consistent with help / --help while I was there.

Changed 5 years ago by Aymeric Augustin

Attachment: 11745-2.patch added

comment:15 Changed 5 years ago by Aymeric Augustin

Owner: changed from nobody to Aymeric Augustin

comment:16 Changed 5 years ago by Aymeric Augustin

Resolution: fixed
Status: newclosed

In [17462]:

(The changeset message doesn't reference this ticket)

comment:17 Changed 5 years ago by anonymous

Easy pickings: set
Needs documentation: set
Needs tests: set
Patch needs improvement: set
Severity: NormalRelease blocker
Type: Cleanup/optimizationNew feature
UI/UX: set

comment:18 Changed 5 years ago by Aymeric Augustin

Easy pickings: unset
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Severity: Release blockerNormal
Type: New featureCleanup/optimization
UI/UX: unset

revert spam

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