1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Refs #26315 -- Cleaned up argparse options in commands.

* Removed type coercion. Options created by argparse are already coerced
  to the correct type.
* Removed fallback default values. Options created by argparse already
  have a default value.
* Used direct indexing. Options created by argparse are always set. This
  eliminates the need to use dict.get().
This commit is contained in:
Jon Dufresne
2016-03-02 18:01:36 -08:00
committed by Tim Graham
parent 4115288b4f
commit 1845bc1d10
21 changed files with 87 additions and 78 deletions

View File

@@ -640,6 +640,14 @@ Miscellaneous
* Tests that violate deferrable database constraints will now error when run on
a database that supports deferrable constraints.
* Built-in management commands now use indexing of keys in ``options``, e.g.
``options['verbosity']``, instead of ``options.get()`` and no longer perform
any type coercion. This could be a problem if you're calling commands using
``Command.execute()`` (which bypasses the argument parser that sets a default
value) instead of :func:`~django.core.management.call_command`. Instead of
calling ``Command.execute()``, pass the command object as the first argument
to ``call_command()``.
.. _deprecated-features-1.10:
Features deprecated in 1.10