Commit 7b2ee757 authored by Tim Graham's avatar Tim Graham
Browse files

[1.9.x] Fixed #26294 -- Clarified call_command()'s handling of args and options.

Backport of 5695c142 from master
parent 9ed08da6
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1749,10 +1749,15 @@ To call a management command from code use ``call_command``.
  the name of the command to call.

``*args``
  a list of arguments accepted by the command.
  a list of arguments accepted by the command. Arguments are passed to the
  argument parser, so you can use the same style as you would on the command
  line. For example, ``call_command('flush', 'verbosity=0')``.

``**options``
  named options accepted on the command-line.
  named options accepted on the command-line. Options are passed to the command
  without triggering the argument parser, which means you'll need to pass the
  correct type. For example, ``call_command('flush', verbosity=0)`` (zero must
  be an integer rather than a string).

Examples::