diff options
| author | Tim Graham <timograham@gmail.com> | 2016-03-12 17:44:08 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-03-14 08:10:17 -0400 |
| commit | 5695c142d282f4681a8d43bb55ec49f11f3fc40e (patch) | |
| tree | 9d7c39edaf601ad95651149c43d9d13c768f4888 /docs | |
| parent | 402da9ab7b2bae807b7ea30c23ef524b0aeb1903 (diff) | |
Fixed #26294 -- Clarified call_command()'s handling of args and options.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/django-admin.txt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index 7ba33f5d17..2437845049 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -1764,10 +1764,15 @@ To call a management command from code use ``call_command``. preferred unless the object is required for testing. ``*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:: |
