Re: Enhancement to the call_command function to allow the use of modules as arguments

2015-08-18 Thread Carl Meyer
On 08/18/2015 10:10 AM, Mike Lissner wrote: > On Tuesday, August 18, 2015 at 12:00:30 PM UTC-4, Carl Meyer wrote: > > > (Doc patches to better reflect that principle in the management command > docs are welcome, IMO.) > > Yeah, it's sounding like this is the change that's needed here. Pr

Re: Enhancement to the call_command function to allow the use of modules as arguments

2015-08-18 Thread Mike Lissner
On Tuesday, August 18, 2015 at 12:00:30 PM UTC-4, Carl Meyer wrote: > > (Doc patches to better reflect that principle in the management command > docs are welcome, IMO.) > > Yeah, it's sounding like this is the change that's needed here. Probably the place to do that is here: https://docs.djan

Re: Enhancement to the call_command function to allow the use of modules as arguments

2015-08-18 Thread Carl Meyer
Hi Marc, Mike, Aymeric, On 08/18/2015 06:52 AM, Marc Tamlyn wrote: > This is a deliberate approach you would use - South used it for years to > customise syncdb. > > call_command is intended as a python API for testing `$ django-admin > foo`. Two of your arguments are based around IDE usage, whic

Re: Enhancement to the call_command function to allow the use of modules as arguments

2015-08-18 Thread Marc Tamlyn
This is a deliberate approach you would use - South used it for years to customise syncdb. call_command is intended as a python API for testing `$ django-admin foo`. Two of your arguments are based around IDE usage, which I don't think is a valid argument, and the third is about reducing string ma

Re: Enhancement to the call_command function to allow the use of modules as arguments

2015-08-18 Thread Mike Lissner
I see. Could this concern be addressed by adding it to the checks framework, so that it throws a warning if there are ever two commands with the same name? On Mon, Aug 17, 2015 at 11:16 AM Aymeric Augustin < aymeric.augus...@polytechnique.org> wrote: > 2015-08-17 16:54 GMT+02:00 Mike Lissner : >

Re: Enhancement to the call_command function to allow the use of modules as arguments

2015-08-17 Thread Aymeric Augustin
2015-08-17 16:54 GMT+02:00 Mike Lissner : > > I’m -1 on removing the Python API that’s equivalent to `django-admin >> my_command`. It’s needed for testing management commands that override >> other management commands. >> > > Not sure what you mean here, but I suspect you're making a good point. >

Re: Enhancement to the call_command function to allow the use of modules as arguments

2015-08-17 Thread Mike Lissner
Thanks for the response, Aymeric. Comments inline. Mike On Sunday, August 16, 2015 at 1:41:19 PM UTC-4, Aymeric Augustin wrote: In general I would suggest to factor your business logic into a function > that you can call independently from the management command. This is better > for testing

Re: Enhancement to the call_command function to allow the use of modules as arguments

2015-08-16 Thread Aymeric Augustin
Hello Mike, I saw your ticket a few days ago, thanks for bringing it up here. > While using call_command (which simplifies calling management commands), it > occurred to me that the API is a little strange. It currently is designed to > work like this: > > call_command('my_command', *args,

Enhancement to the call_command function to allow the use of modules as arguments

2015-08-16 Thread Mike Lissner
I recently filed a bug about this and was redirected here for discussion. While using call_command (which simplifies calling management commands), it occurred to me that the API is a little strange. It currently is designed to work like this: c