Code

Opened 6 years ago

Closed 6 years ago

#7784 closed (wontfix)

Command.__handle__ instead of Command.handle

Reported by: hvendelbo Owned by: nobody
Component: Core (Other) Version: master
Severity: Keywords: commands
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I can see why the Command class convention is highly desirable. But wouldn't it make more sense to run a command using a call function rather than a handle function?

The current pattern for writing Django Commands has a Javaesque base library dependency. Given how popular commands already are today, it would be desirable to make it easy
to write commands that are independent of Django modules.

A command is a callable object with option_list, help, args attributes is a convention that would be useful in Python in general.

Attachments (0)

Change History (2)

comment:1 Changed 6 years ago by hvendelbo

  • Component changed from Uncategorized to Core framework
  • Keywords commands added
  • milestone set to 1.0 alpha
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 6 years ago by mtredinnick

  • milestone 1.0 alpha deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Firstly, please do not assign milestones to your own tickets. It certainly isn't 1.0-alpha importance.

Secondly, you don't really explain what you're talking about here beyond just renaming a method. Management commands are always going to be run via django-admin.py, by definition. So using the common base class makes things easy in a lot of ways. If you also want to be able to run it separately write it separately and add the wrapper class for management support, but that's hardly going to be a common case.

Closing as wontfix, since I don't see any benefit at all here. If you want to go further with this, please start a thread on django-dev explaining in a bit more detail what the problem is that you're trying to solve.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.