#26190: Return final management command result from call_command
-------------------------------------+-------------------------------------
Reporter: claudep | Owner: nobody
Type: New | Status: new
feature |
Component: Core | Version: master
(Management commands) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Currently, the result returned from the `handle` method of a management
command is directed by default to the console in the `execute` method by
writing to `self.stdout`, but it is not returned from the `execute`
method, so `call_command` does not receive it either.
I would suggest to adapt this behavior and also return this output from
`execute` (and consequently by `call_command` so we can easily get access
to this result from `call_command`). The behavior when calling the command
by the command line would be unchanged.
I even thought about not writing this result to `self.stdout` when the
command is called by `call_command`, but this would be backwards
incompatible and I don't see a good deprecation path for this.
--
Ticket URL: <https://code.djangoproject.com/ticket/26190>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.af357d3c48d4265b29736d9697cdace7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.