Opened 16 years ago

Closed 16 years ago

#7784 closed (wontfix)

Command.__handle__ instead of Command.handle

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

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.

Change History (2)

comment:1 by Henrik Vendelbo, 16 years ago

Component: UncategorizedCore framework
Keywords: commands added
milestone: 1.0 alpha

comment:2 by Malcolm Tredinnick, 16 years ago

milestone: 1.0 alpha
Resolution: wontfix
Status: newclosed

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.

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