Opened 15 years ago

Closed 13 years ago

Last modified 13 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: dev
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 15 years ago.
Categorizes the commands in the "manage.py help" list
11745-2.patch (8.2 KB ) - added by Aymeric Augustin 13 years ago.

Download all attachments as: .zip

Change History (20)

by Vlada Macek, 15 years ago

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

comment:1 by anonymous, 15 years ago

Cc: t.django@… added; tuttle@… removed

comment:2 by Thejaswi Puthraya, 15 years ago

Component: UncategorizedCore framework

comment:3 by Russell Keith-Magee, 15 years ago

Triage Stage: UnreviewedAccepted

comment:4 by Julien Phalip, 14 years ago

Severity: Normal
Type: Cleanup/optimization

comment:5 by Graham King, 13 years ago

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 by Martin Mahner, 13 years ago

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 13 years ago by Martin Mahner (previous) (diff)

comment:7 by Jannis Leidel, 13 years ago

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

comment:8 by Jannis Leidel, 13 years ago

Patch needs improvement: set

comment:9 by Jannis Leidel, 13 years ago

Component: Core (Other)Core (Management commands)

comment:10 by sebastien.fievet@…, 13 years ago

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

comment:11 by Aymeric Augustin, 13 years ago

#16445 was a duplicate.

comment:12 by Jacob, 13 years ago

milestone: 1.4

Milestone 1.4 deleted

comment:13 by Aymeric Augustin, 13 years ago

Patch needs improvement: unset

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

comment:14 by Aymeric Augustin, 13 years ago

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

by Aymeric Augustin, 13 years ago

Attachment: 11745-2.patch added

comment:15 by Aymeric Augustin, 13 years ago

Owner: changed from nobody to Aymeric Augustin

comment:16 by Aymeric Augustin, 13 years ago

Resolution: fixed
Status: newclosed

In [17462]:

Fixed #11745 -- Grouped commands by application in the output of manage.py help. Made 'version' consistent with 'help' while I was in the area, and added tests. Thanks Jannis for the feedback and review.

comment:17 by anonymous, 13 years ago

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 by Aymeric Augustin, 13 years ago

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