Opened 6 years ago

Closed 3 years ago

Last modified 3 years ago

#11745 closed Cleanup/optimization (fixed)

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

Reported by: Tuttle Owned by: aaugustin
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 Tuttle 6 years ago.
Categorizes the commands in the "manage.py help" list
11745-2.patch (8.2 KB) - added by aaugustin 3 years ago.

Download all attachments as: .zip

Change History (20)

Changed 6 years ago by Tuttle

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

comment:1 Changed 5 years ago by anonymous

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

comment:2 Changed 5 years ago by thejaswi_puthraya

  • Component changed from Uncategorized to Core framework

comment:3 Changed 5 years ago by russellm

  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 4 years ago by julien

  • Severity set to Normal
  • Type set to Cleanup/optimization

comment:5 Changed 4 years ago by graham_king

  • Easy pickings unset
  • Keywords help color django-admin manage.py added
  • milestone set to 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 4 years ago by bartTC

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 4 years ago by bartTC (previous) (diff)

comment:7 Changed 4 years ago by jezdez

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

comment:8 Changed 4 years ago by jezdez

  • Patch needs improvement set

comment:9 Changed 4 years ago by jezdez

  • Component changed from Core (Other) to Core (Management commands)

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

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

comment:11 Changed 4 years ago by aaugustin

#16445 was a duplicate.

comment:12 Changed 3 years ago by jacob

  • milestone 1.4 deleted

Milestone 1.4 deleted

comment:13 Changed 3 years ago by aaugustin

  • Patch needs improvement unset

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

comment:14 Changed 3 years ago by aaugustin

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

Changed 3 years ago by aaugustin

comment:15 Changed 3 years ago by aaugustin

  • Owner changed from nobody to aaugustin

comment:16 Changed 3 years ago by aaugustin

  • Resolution set to fixed
  • Status changed from new to closed

In [17462]:

(The changeset message doesn't reference this ticket)

comment:17 Changed 3 years ago by anonymous

  • Easy pickings set
  • Needs documentation set
  • Needs tests set
  • Patch needs improvement set
  • Severity changed from Normal to Release blocker
  • Type changed from Cleanup/optimization to New feature
  • UI/UX set

comment:18 Changed 3 years ago by aaugustin

  • Easy pickings unset
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Severity changed from Release blocker to Normal
  • Type changed from New feature to Cleanup/optimization
  • UI/UX unset

revert spam

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